comparison gtk/dw.c @ 1795:9304241b7b33

Added new dw_window_set_focus() function and attempted to fix... Intial focus after a subsequent dw_window_show() on Mac.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 24 Sep 2012 23:24:25 +0000
parents 97b1edb41d44
children 7f549994b633
comparison
equal deleted inserted replaced
1794:97b1edb41d44 1795:9304241b7b33
12158 DW_MUTEX_UNLOCK; 12158 DW_MUTEX_UNLOCK;
12159 return; 12159 return;
12160 } 12160 }
12161 12161
12162 /* 12162 /*
12163 * Sets the current focus item for a window/dialog.
12164 * Parameters:
12165 * handle: Handle to the dialog item to be focused.
12166 * Remarks:
12167 * This is for use after showing the window/dialog.
12168 */
12169 void API dw_window_set_focus(HWND handle)
12170 {
12171 int _locked_by_me = FALSE;
12172
12173 if(!handle)
12174 return;
12175
12176 DW_MUTEX_LOCK;
12177 gtk_widget_grab_focus(handle);
12178 DW_MUTEX_UNLOCK;
12179 }
12180
12181 /*
12163 * Sets the default focus item for a window/dialog. 12182 * Sets the default focus item for a window/dialog.
12164 * Parameters: 12183 * Parameters:
12165 * window: Toplevel window or dialog. 12184 * window: Toplevel window or dialog.
12166 * defaultitem: Handle to the dialog item to be default. 12185 * defaultitem: Handle to the dialog item to be default.
12186 * Remarks:
12187 * This is for use before showing the window/dialog.
12167 */ 12188 */
12168 void dw_window_default(HWND window, HWND defaultitem) 12189 void dw_window_default(HWND window, HWND defaultitem)
12169 { 12190 {
12170 int _locked_by_me = FALSE; 12191 int _locked_by_me = FALSE;
12171 12192