-// ----------------------------------------------------------------------------
-// GTK callbacks
-// ----------------------------------------------------------------------------
-
-#if wxUSE_MENUS_NATIVE
-
-//-----------------------------------------------------------------------------
-// "child_attached" of menu bar
-//-----------------------------------------------------------------------------
-
-static void gtk_menu_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
-{
- if (!win->m_hasVMT) return;
-
- win->m_menuBarDetached = FALSE;
- win->GtkUpdateSize();
-}
-
-//-----------------------------------------------------------------------------
-// "child_detached" of menu bar
-//-----------------------------------------------------------------------------
-
-static void gtk_menu_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
-{
- if (g_isIdle)
- wxapp_install_idle_handler();
-
- if (!win->m_hasVMT) return;
-
- // Raise the client area area
- gdk_window_raise( win->m_wxwindow->window );
-
- win->m_menuBarDetached = TRUE;
- win->GtkUpdateSize();
-}
-
-#endif // wxUSE_MENUS_NATIVE
-
-#if wxUSE_TOOLBAR
-//-----------------------------------------------------------------------------
-// "child_attached" of tool bar
-//-----------------------------------------------------------------------------
-
-static void gtk_toolbar_attached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
-{
- if (!win->m_hasVMT) return;
-
- win->m_toolBarDetached = FALSE;
- win->GtkUpdateSize();
-}
-
-//-----------------------------------------------------------------------------
-// "child_detached" of tool bar
-//-----------------------------------------------------------------------------
-
-static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidget *WXUNUSED(child), wxFrame *win )
-{
- if (g_isIdle)
- wxapp_install_idle_handler();
-
- if (!win->m_hasVMT) return;
-
- // Raise the client area area
- gdk_window_raise( win->m_wxwindow->window );
-
- win->m_toolBarDetached = TRUE;
- win->GtkUpdateSize();
-}
-#endif // wxUSE_TOOLBAR
-
-
-// ----------------------------------------------------------------------------
-// wxFrame itself
-// ----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-// InsertChild for wxFrame
-//-----------------------------------------------------------------------------
-
-/* Callback for wxFrame. This very strange beast has to be used because
- * C++ has no virtual methods in a constructor. We have to emulate a
- * virtual function here as wxWindows requires different ways to insert
- * a child in container classes. */
-
-static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child )
-{
- wxASSERT( GTK_IS_WIDGET(child->m_widget) );
-
- if (!parent->m_insertInClientArea)
- {
- // These are outside the client area
- wxFrame* frame = (wxFrame*) parent;
- gtk_pizza_put( GTK_PIZZA(frame->m_mainWidget),
- GTK_WIDGET(child->m_widget),
- child->m_x,
- child->m_y,
- child->m_width,
- child->m_height );
-
-#if wxUSE_TOOLBAR_NATIVE
- // We connect to these events for recalculating the client area
- // space when the toolbar is floating
- if (wxIS_KIND_OF(child,wxToolBar))
- {
- 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 );
- }
- }
-#endif // wxUSE_TOOLBAR
- }
- else
- {
- // These are inside the client area
- gtk_pizza_put( GTK_PIZZA(parent->m_wxwindow),
- GTK_WIDGET(child->m_widget),
- child->m_x,
- child->m_y,
- child->m_width,
- child->m_height );
- }
-
- // Resize on OnInternalIdle
- parent->GtkUpdateSize();
-}
-