Mercurial > dwindows
comparison os2/dw.c @ 1034:af2c93f78ae9
Attempt at making dw_window_set/get_text() work on spinbuttons on OS/2.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 26 May 2011 03:24:06 +0000 |
parents | 60d6d2c87116 |
children | 31dc5b4f6cfc |
comparison
equal
deleted
inserted
replaced
1033:c4dae8a3cf9a | 1034:af2c93f78ae9 |
---|---|
5765 * handle: Handle to the window. | 5765 * handle: Handle to the window. |
5766 * text: The text associsated with a given window. | 5766 * text: The text associsated with a given window. |
5767 */ | 5767 */ |
5768 void API dw_window_set_text(HWND handle, char *text) | 5768 void API dw_window_set_text(HWND handle, char *text) |
5769 { | 5769 { |
5770 WinSetWindowText(handle, text); | 5770 HWND entryfield = WinWindowFromID(handle, 1703); |
5771 WinSetWindowText(entryfield ? entryfield : handle, text); | |
5771 } | 5772 } |
5772 | 5773 |
5773 /* | 5774 /* |
5774 * Gets the text used for a given window. | 5775 * Gets the text used for a given window. |
5775 * Parameters: | 5776 * Parameters: |
5777 * Returns: | 5778 * Returns: |
5778 * text: The text associsated with a given window. | 5779 * text: The text associsated with a given window. |
5779 */ | 5780 */ |
5780 char * API dw_window_get_text(HWND handle) | 5781 char * API dw_window_get_text(HWND handle) |
5781 { | 5782 { |
5782 int len = WinQueryWindowTextLength(handle); | 5783 HWND entryfield = WinWindowFromID(handle, 1703); |
5784 int len = WinQueryWindowTextLength(entryfield ? entryfield : handle); | |
5783 char *tempbuf = calloc(1, len + 2); | 5785 char *tempbuf = calloc(1, len + 2); |
5784 | 5786 |
5785 WinQueryWindowText(handle, len + 1, tempbuf); | 5787 WinQueryWindowText(entryfield ? entryfield : handle, len + 1, tempbuf); |
5786 | 5788 |
5787 return tempbuf; | 5789 return tempbuf; |
5788 } | 5790 } |
5789 | 5791 |
5790 /* | 5792 /* |