m_needParent = FALSE;
m_style = style;
- PreCreation( (wxWindow *) NULL, -1, wxDefaultPosition, wxDefaultSize, style, "menu" );
+ if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) ||
+ !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, _T("menubar") ))
+ {
+ wxFAIL_MSG( _T("wxMenuBar creation failed") );
+ return;
+ }
m_menus.DeleteContents( TRUE );
m_needParent = FALSE;
m_style = 0;
- PreCreation( (wxWindow *) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, "menu" );
-
+ if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) ||
+ !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("menubar") ))
+ {
+ wxFAIL_MSG( _T("wxMenuBar creation failed") );
+ return;
+ }
+
m_menus.DeleteContents( TRUE );
/* GTK 1.2.0 doesn't have gtk_item_factory_get_item(), but GTK 1.2.1 has. */
IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
-wxMenu::wxMenu( const wxString& title, const wxFunction func, long style )
-{
- Init(title, func, style);
-}
-
-wxMenu::wxMenu(long style)
-{
- Init(wxEmptyString, (wxFunction) NULL, style);
-}
-
void
wxMenu::Init( const wxString& title,
long style,
-#ifdef WXWIN_COMPATIBILITY
- , const wxFunction func
-#endif
- )
+ const wxFunction func
+ )
{
m_title = title;
m_items.DeleteContents( TRUE );
m_menu = gtk_menu_new(); // Do not show!
#endif
-#ifdef WXWIN_COMPATIBILITY
m_callback = func;
-#endif
m_eventHandler = this;
m_clientData = (void*) NULL;
wxMenu::~wxMenu()
{
- /* how do we delete an item-factory ? */
+ /* how do we delete an item-factory ? */
+ gtk_widget_destroy( m_menu );
+
}
void wxMenu::SetTitle( const wxString& title )