diff gtk3/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 2cfbfccbbafe
children 7f549994b633
line wrap: on
line diff
--- a/gtk3/dw.c	Mon Aug 13 06:18:30 2012 +0000
+++ b/gtk3/dw.c	Mon Sep 24 23:24:25 2012 +0000
@@ -10376,10 +10376,31 @@
 }
 
 /*
+ * Sets the current focus item for a window/dialog.
+ * Parameters:
+ *         handle: Handle to the dialog item to be focused.
+ * Remarks:
+ *          This is for use after showing the window/dialog.
+ */
+void API dw_window_set_focus(HWND handle)
+{
+    int _locked_by_me = FALSE;
+
+    if(!handle)
+       return;
+
+    DW_MUTEX_LOCK;
+	gtk_widget_grab_focus(handle);
+    DW_MUTEX_UNLOCK;
+}
+
+/*
  * Sets the default focus item for a window/dialog.
  * Parameters:
  *         window: Toplevel window or dialog.
  *         defaultitem: Handle to the dialog item to be default.
+ * Remarks:
+ *          This is for use before showing the window/dialog.
  */
 void dw_window_default(HWND window, HWND defaultitem)
 {