# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1306380246 0 # Node ID af2c93f78ae978cfd264adb253bb718483aea272 # Parent c4dae8a3cf9a77090bd71c9e78fed0b1ab42d0a7 Attempt at making dw_window_set/get_text() work on spinbuttons on OS/2. diff -r c4dae8a3cf9a -r af2c93f78ae9 os2/dw.c --- 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; }