+ wxTopLevelWindows.Append( this );
+
+ m_needParent = FALSE;
+
+ if (!PreCreation( parent, pos, size ) ||
+ !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+ {
+ wxFAIL_MSG( wxT("wxFrameGTK creation failed") );
+ return FALSE;
+ }
+
+ m_title = title;
+
+ m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame;
+
+ GtkWindowType win_type = GTK_WINDOW_TOPLEVEL;
+
+ if (style & wxFRAME_TOOL_WINDOW)
+ win_type = GTK_WINDOW_POPUP;
+
+ m_widget = gtk_window_new( win_type );
+
+ if ((m_parent) && (HasFlag(wxFRAME_FLOAT_ON_PARENT)) && (GTK_IS_WINDOW(m_parent->m_widget)))
+ gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) );
+
+ if (!name.IsEmpty())
+ gtk_window_set_wmclass( GTK_WINDOW(m_widget), name.mb_str(), name.mb_str() );
+
+#ifdef __WXDEBUG__
+ debug_focus_in( m_widget, wxT("wxFrameGTK::m_widget"), name );
+#endif
+
+ gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() );
+ GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
+
+ gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
+ GTK_SIGNAL_FUNC(gtk_frame_delete_callback), (gpointer)this );
+
+ /* m_mainWidget holds the toolbar, the menubar and the client area */
+ m_mainWidget = gtk_pizza_new();
+ gtk_widget_show( m_mainWidget );
+ GTK_WIDGET_UNSET_FLAGS( m_mainWidget, GTK_CAN_FOCUS );
+ gtk_container_add( GTK_CONTAINER(m_widget), m_mainWidget );
+
+ /* for m_mainWidget themes */
+ gtk_signal_connect( GTK_OBJECT(m_mainWidget), "expose_event",
+ GTK_SIGNAL_FUNC(gtk_window_expose_callback), (gpointer)this );
+ gtk_signal_connect( GTK_OBJECT(m_mainWidget), "draw",
+ GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this );
+
+#ifdef __WXDEBUG__
+ debug_focus_in( m_mainWidget, wxT("wxFrameGTK::m_mainWidget"), name );
+#endif
+
+ /* m_wxwindow only represents the client area without toolbar and menubar */
+ m_wxwindow = gtk_pizza_new();
+ gtk_widget_show( m_wxwindow );
+ gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow );
+
+#ifdef __WXDEBUG__
+ debug_focus_in( m_wxwindow, wxT("wxFrameGTK::m_wxwindow"), name );
+#endif
+
+ /* we donm't allow the frame to get the focus as otherwise
+ the frame will grab it at arbitrary focus changes. */
+ GTK_WIDGET_UNSET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
+
+ if (m_parent) m_parent->AddChild( this );
+
+ /* the user resized the frame by dragging etc. */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
+ GTK_SIGNAL_FUNC(gtk_frame_size_callback), (gpointer)this );
+
+ PostCreation();
+
+ if ((m_x != -1) || (m_y != -1))
+ gtk_widget_set_uposition( m_widget, m_x, m_y );
+ gtk_widget_set_usize( m_widget, m_width, m_height );
+
+ /* we cannot set MWM hints and icons before the widget has
+ been realized, so we do this directly after realization */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
+ GTK_SIGNAL_FUNC(gtk_frame_realized_callback), (gpointer) this );
+
+ /* the only way to get the window size is to connect to this event */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "configure_event",
+ GTK_SIGNAL_FUNC(gtk_frame_configure_callback), (gpointer)this );
+
+ /* map and unmap for iconized state */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "map_event",
+ GTK_SIGNAL_FUNC(gtk_frame_map_callback), (gpointer)this );
+ gtk_signal_connect( GTK_OBJECT(m_widget), "unmap_event",
+ GTK_SIGNAL_FUNC(gtk_frame_unmap_callback), (gpointer)this );
+
+ /* the only way to get the window size is to connect to this event */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "configure_event",
+ GTK_SIGNAL_FUNC(gtk_frame_configure_callback), (gpointer)this );
+
+ /* disable native tab traversal */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "focus",
+ GTK_SIGNAL_FUNC(gtk_frame_focus_callback), (gpointer)this );
+
+ return TRUE;
+}
+
+wxFrameGTK::~wxFrameGTK()
+{
+ m_isBeingDeleted = TRUE;
+
+ DeleteAllBars();
+
+ wxTopLevelWindows.DeleteObject( this );
+
+ if (wxTheApp->GetTopWindow() == this)
+ wxTheApp->SetTopWindow( (wxWindow*) NULL );
+
+ if ((wxTopLevelWindows.Number() == 0) &&
+ (wxTheApp->GetExitOnFrameDelete()))
+ {
+ wxTheApp->ExitMainLoop();
+ }
+}
+
+bool wxFrameGTK::ShowFullScreen(bool show, long style )
+{
+ if (show == m_fsIsShowing) return FALSE; // return what?
+
+ m_fsIsShowing = show;
+
+ if (show)
+ {
+ m_fsSaveStyle = m_windowStyle;
+ m_fsSaveFlag = style;
+ GetPosition( &m_fsSaveFrame.x, &m_fsSaveFrame.y );
+ GetSize( &m_fsSaveFrame.width, &m_fsSaveFrame.height );
+
+ gtk_widget_hide( m_widget );
+ gtk_widget_unrealize( m_widget );
+
+ m_windowStyle = wxSIMPLE_BORDER;
+
+ int x;
+ int y;
+ wxDisplaySize( &x, &y );
+ SetSize( 0, 0, x, y );
+
+ gtk_widget_realize( m_widget );
+ gtk_widget_show( m_widget );
+ }
+ else
+ {
+ gtk_widget_hide( m_widget );
+ gtk_widget_unrealize( m_widget );
+
+ m_windowStyle = m_fsSaveStyle;
+
+ SetSize( m_fsSaveFrame.x, m_fsSaveFrame.y, m_fsSaveFrame.width, m_fsSaveFrame.height );
+
+ gtk_widget_realize( m_widget );
+ gtk_widget_show( m_widget );
+ }
+
+ return TRUE;
+}
+
+// ----------------------------------------------------------------------------
+// overridden wxWindow methods
+// ----------------------------------------------------------------------------
+
+bool wxFrameGTK::Show( bool show )