]> git.saurik.com Git - wxWidgets.git/commitdiff
Send wxEVT_CREATE and do other post-realization initialization even if the widget...
authorVáclav Slavík <vslavik@fastmail.fm>
Wed, 19 Oct 2011 16:19:55 +0000 (16:19 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Wed, 19 Oct 2011 16:19:55 +0000 (16:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/window.cpp

index 04b6e8a983ed07896daf3712b45fa728c17bfcfd..2c416d0e80cc43ae8ff656e02403db1d99b076dc 100644 (file)
@@ -2407,10 +2407,18 @@ void wxWindowGTK::PostCreation()
 
     ConnectWidget( connect_widget );
 
 
     ConnectWidget( connect_widget );
 
-    /* We cannot set colours, fonts and cursors before the widget has
-       been realized, so we do this directly after realization */
-    g_signal_connect (connect_widget, "realize",
-                      G_CALLBACK (gtk_window_realized_callback), this);
+    // We cannot set colours, fonts and cursors before the widget has been
+    // realized, so we do this directly after realization -- unless the widget
+    // was in fact realized already.
+    if ( gtk_widget_get_realized(connect_widget) )
+    {
+        gtk_window_realized_callback(connect_widget, this);
+    }
+    else
+    {
+        g_signal_connect (connect_widget, "realize",
+                          G_CALLBACK (gtk_window_realized_callback), this);
+    }
 
     if (!IsTopLevel())
     {
 
     if (!IsTopLevel())
     {