]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/frame.cpp
Commited Bryan Petty's blind fix patch.
[wxWidgets.git] / src / gtk / frame.cpp
index 70136afb42cc6784a0b0c534a51504b7383b8845..19cacb5d83659444f53608ad78cbc8f2df99f9af 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        frame.cpp
+// Name:        src/gtk/frame.cpp
 // Purpose:
 // Author:      Robert Roebling
 // Id:          $Id$
@@ -7,6 +7,9 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 // ============================================================================
 // declarations
 // ============================================================================
 // headers
 // ----------------------------------------------------------------------------
 
-// For compilers that support precompilation, includes "wx.h".
-#include "wx/wxprec.h"
-
-#include "wx/defs.h"
-
 #include "wx/frame.h"
-#include "wx/dialog.h"
-#include "wx/control.h"
-#include "wx/app.h"
-#include "wx/menu.h"
-#if wxUSE_TOOLBAR
+
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+    #include "wx/dcclient.h"
+    #include "wx/menu.h"
+    #include "wx/dialog.h"
+    #include "wx/control.h"
     #include "wx/toolbar.h"
-#endif
-#if wxUSE_STATUSBAR
     #include "wx/statusbr.h"
-#endif
-#include "wx/dcclient.h"
+#endif // WX_PRECOMP
 
 #include <glib.h>
 #include "wx/gtk/private.h"
 const int wxSTATUS_HEIGHT  = 25;
 const int wxPLACE_HOLDER   = 0;
 
-// ----------------------------------------------------------------------------
-// idle system
-// ----------------------------------------------------------------------------
-
-extern void wxapp_install_idle_handler();
-extern bool g_isIdle;
-
 // ----------------------------------------------------------------------------
 // event tables
 // ----------------------------------------------------------------------------
@@ -180,11 +170,12 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
             wxToolBar *toolBar = (wxToolBar*) child;
             if (toolBar->GetWindowStyle() & wxTB_DOCKABLE)
             {
-                gtk_signal_connect( GTK_OBJECT(toolBar->m_widget), "child_attached",
-                    GTK_SIGNAL_FUNC(gtk_toolbar_attached_callback), (gpointer)parent );
-
-                gtk_signal_connect( GTK_OBJECT(toolBar->m_widget), "child_detached",
-                    GTK_SIGNAL_FUNC(gtk_toolbar_detached_callback), (gpointer)parent );
+                g_signal_connect (toolBar->m_widget, "child_attached",
+                                  G_CALLBACK (gtk_toolbar_attached_callback),
+                                  parent);
+                g_signal_connect (toolBar->m_widget, "child_detached",
+                                  G_CALLBACK (gtk_toolbar_detached_callback),
+                                  parent);
             }
         }
 #endif // wxUSE_TOOLBAR
@@ -199,9 +190,6 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
                          child->m_width,
                          child->m_height );
     }
-
-    // Resize on OnInternalIdle
-    parent->GtkUpdateSize();
 }
 
 // ----------------------------------------------------------------------------
@@ -489,7 +477,12 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
         gtk_pizza_set_size( GTK_PIZZA(m_wxwindow),
                             m_frameStatusBar->m_widget,
                             xx, yy, ww, hh );
-        gtk_widget_draw( m_frameStatusBar->m_widget, (GdkRectangle*) NULL );
+        if (GTK_WIDGET_DRAWABLE (m_frameStatusBar->m_widget))
+        {
+            gtk_widget_queue_draw (m_frameStatusBar->m_widget);
+            // FIXME: Do we really want to force an immediate redraw?
+            gdk_window_process_updates (m_frameStatusBar->m_widget->window, TRUE);
+        }
     }
 #endif // wxUSE_STATUSBAR
 
@@ -558,11 +551,13 @@ void wxFrame::DetachMenuBar()
 
         if (m_frameMenuBar->GetWindowStyle() & wxMB_DOCKABLE)
         {
-            gtk_signal_disconnect_by_func( GTK_OBJECT(m_frameMenuBar->m_widget),
-                GTK_SIGNAL_FUNC(gtk_menu_attached_callback), (gpointer)this );
+            g_signal_handlers_disconnect_by_func (m_frameMenuBar->m_widget,
+                    (gpointer) gtk_menu_attached_callback,
+                    this);
 
-            gtk_signal_disconnect_by_func( GTK_OBJECT(m_frameMenuBar->m_widget),
-                GTK_SIGNAL_FUNC(gtk_menu_detached_callback), (gpointer)this );
+            g_signal_handlers_disconnect_by_func (m_frameMenuBar->m_widget,
+                    (gpointer) gtk_menu_detached_callback,
+                    this);
         }
 
         gtk_widget_ref( m_frameMenuBar->m_widget );
@@ -591,11 +586,12 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
 
         if (menuBar->GetWindowStyle() & wxMB_DOCKABLE)
         {
-            gtk_signal_connect( GTK_OBJECT(menuBar->m_widget), "child_attached",
-                GTK_SIGNAL_FUNC(gtk_menu_attached_callback), (gpointer)this );
-
-            gtk_signal_connect( GTK_OBJECT(menuBar->m_widget), "child_detached",
-                GTK_SIGNAL_FUNC(gtk_menu_detached_callback), (gpointer)this );
+            g_signal_connect (menuBar->m_widget, "child_attached",
+                              G_CALLBACK (gtk_menu_attached_callback),
+                              this);
+            g_signal_connect (menuBar->m_widget, "child_detached",
+                              G_CALLBACK (gtk_menu_detached_callback),
+                              this);
         }
 
         gtk_widget_show( m_frameMenuBar->m_widget );