+ // always create a frame of some reasonable, even if arbitrary, size (at
+ // least for MSW compatibility)
+ wxSize size = sizeOrig;
+ if ( size.x == -1 || size.y == -1 )
+ {
+ wxSize sizeDpy = wxGetDisplaySize();
+ if ( size.x == -1 )
+ size.x = sizeDpy.x / 3;
+ if ( size.y == -1 )
+ size.y = sizeDpy.y / 5;
+ }
+
+ wxTopLevelWindows.Append( this );
+
+ m_needParent = FALSE;
+
+ if (!PreCreation( parent, pos, size ) ||
+ !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
+ {
+ wxFAIL_MSG( wxT("wxFrame 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("wxFrame::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("wxFrame::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("wxFrame::m_wxwindow"), name );
+#endif
+
+ /* we donm't allow the frame to get the focus as otherwise
+ the frame will grabit at arbitrary fcous 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 );