X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/91af089567c5e13a408f1c529f6830d12cdc6c4e..c08ee0349dd4ed6d62f734fe576e47c7027e2b9e:/src/gtk/frame.cpp diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 2e602ab9dc..7683d527db 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -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 // ============================================================================ @@ -15,27 +18,17 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "frame.h" -#endif - -// 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 #include "wx/gtk/private.h" @@ -52,13 +45,6 @@ const int wxSTATUS_HEIGHT = 25; const int wxPLACE_HOLDER = 0; -// ---------------------------------------------------------------------------- -// idle system -// ---------------------------------------------------------------------------- - -extern void wxapp_install_idle_handler(); -extern bool g_isIdle; - // ---------------------------------------------------------------------------- // event tables // ---------------------------------------------------------------------------- @@ -184,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 @@ -493,7 +480,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 @@ -562,11 +554,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 ); @@ -595,11 +589,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 ); @@ -622,12 +617,12 @@ void wxFrame::UpdateMenuBarSize() // this is called after Remove with a NULL m_frameMenuBar if ( m_frameMenuBar ) - (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_frameMenuBar->m_widget) )->size_request ) - (m_frameMenuBar->m_widget, &req ); + (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_frameMenuBar->m_widget) )->size_request ) + (m_frameMenuBar->m_widget, &req ); m_menuBarHeight = req.height; - // resize window in OnInternalIdle + // resize window in OnInternalIdle GtkUpdateSize(); } @@ -714,4 +709,3 @@ void wxFrame::PositionStatusBar() GtkUpdateSize(); } #endif // wxUSE_STATUSBAR -