- wxTopLevelWindows.Append( this );
-
- m_needParent = FALSE;
-
- PreCreation( parent, id, pos, size, style, name );
-
- m_title = title;
-
- m_insertCallback = wxInsertChildInFrame;
-
- GtkWindowType win_type = GTK_WINDOW_TOPLEVEL;
- if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP;
-
- m_widget = gtk_window_new( win_type );
-
- 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_myfixed_new();
- gtk_widget_show( m_mainWidget );
- GTK_WIDGET_UNSET_FLAGS( m_mainWidget, GTK_CAN_FOCUS );
- gtk_container_add( GTK_CONTAINER(m_widget), m_mainWidget );
-
- /* m_wxwindow only represents the client area without toolbar and menubar */
- m_wxwindow = gtk_myfixed_new();
- gtk_widget_show( m_wxwindow );
- gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow );
-
- /* we allow the frame to get the focus as otherwise no
- key events will get sent to it. the point with this is
- that the menu's key accelerators work by interceting
- key events here */
- GTK_WIDGET_SET_FLAGS( m_wxwindow, GTK_CAN_FOCUS );
- gtk_widget_grab_focus( m_wxwindow );
-
- if (m_parent) m_parent->AddChild( this );
-
- PostCreation();
-
- /* 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 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 );
-
- /* 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 );
-
- return TRUE;
-}
-
-wxFrame::~wxFrame()
-{
- if (m_frameMenuBar) delete m_frameMenuBar;
- m_frameMenuBar = (wxMenuBar *) NULL;
-
- if (m_frameStatusBar) delete m_frameStatusBar;
- m_frameStatusBar = (wxStatusBar *) NULL;
-
- if (m_frameToolBar) delete m_frameToolBar;
- m_frameToolBar = (wxToolBar *) NULL;
-
- wxTopLevelWindows.DeleteObject( this );
-
- if (wxTheApp->GetTopWindow() == this)
- wxTheApp->SetTopWindow( (wxWindow*) NULL );
-
- if (wxTopLevelWindows.Number() == 0)
- wxTheApp->ExitMainLoop();
-}
-
-bool wxFrame::Show( bool show )
-{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
-
-#if 0
- if (show && !m_sizeSet)
- {
- /* by calling GtkOnSize here, we don't have to call
- either after showing the frame, which would entail
- much ugly flicker or from within the size_allocate
- handler, because GTK 1.1.X forbids that. */
-
- GtkOnSize( m_x, m_y, m_width, m_height );
- }
-#endif
-
- return wxWindow::Show( show );