changeset 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 c4dae8a3cf9a
children 31dc5b4f6cfc
files os2/dw.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/os2/dw.c	Wed May 25 03:18:00 2011 +0000
+++ b/os2/dw.c	Thu May 26 03:24:06 2011 +0000
@@ -5767,7 +5767,8 @@
  */
 void API dw_window_set_text(HWND handle, char *text)
 {
-   WinSetWindowText(handle, text);
+   HWND entryfield = WinWindowFromID(handle, 1703);
+   WinSetWindowText(entryfield ? entryfield : handle, text);
 }
 
 /*
@@ -5779,10 +5780,11 @@
  */
 char * API dw_window_get_text(HWND handle)
 {
-   int len = WinQueryWindowTextLength(handle);
+   HWND entryfield = WinWindowFromID(handle, 1703);
+   int len = WinQueryWindowTextLength(entryfield ? entryfield : handle);
    char *tempbuf = calloc(1, len + 2);
 
-   WinQueryWindowText(handle, len + 1, tempbuf);
+   WinQueryWindowText(entryfield ? entryfield : handle, len + 1, tempbuf);
 
    return tempbuf;
 }