List Info

Thread: Problem with About command on MacOSX




Problem with About command on MacOSX
country flaguser name
United States
2007-02-04 08:40:27

Hi again!

I am using MacOSX 10.4.8 and wxWidgets 2.6.3.

I am trying to build a document-like application with DB 3.12, and
I have a problem with the About command.

The default Application menu (previously the "Apple" menu) has an
About command that apparently is not issuing a wxID_ABOUT event.
Adding a menubar with only a File/Open menu is not enough. If I do
this I get the Application menu, a File/Open menu, a Window menu, and
an empty Help menu. Selecting Application/About does not open the
OnAbout window.

However, if I add a Help/About menu in DB and attach wxID_ABOUT to
this item, Application/About opens the OnAbout window as it should.
BUT now I have TWO empty Help menus on the menubar.

DB generates a menu setup like this:
wxMenuBar* AppResources::CreateMenuMenubar()
{
wxMenuBar* menuBar = new wxMenuBar;
wxMenu* itemMenu2 = new wxMenu;
itemMenu2->Append(wxID_OPEN, _("Open"), _T(""), wxITEM_NORMAL);
menuBar->Append(itemMenu2, _("File"));
wxMenu* itemMenu4 = new wxMenu;
itemMenu4->Append(wxID_ABOUT, _("About"), _T(""), wxITEM_NORMAL);
menuBar->Append(itemMenu4, _("Help"));
return menuBar;
}

If I study the sample minimal.cpp I see this:

#if wxUSE_MENUS
// create a menu bar
wxMenu *fileMenu = new wxMenu;
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(Minimal_About, _T("&About...tF1"), _T("Show
about dialog"));
fileMenu->Append(Minimal_Quit, _T("E&xittAlt-X"), _T("Quit this
program"));
wxMenuBar *menuBar = new wxMenuBar();
menuBar->Append(fileMenu, _T("&File"));
menuBar->Append(helpMenu, _T("&Help"));
SetMenuBar(menuBar);
#endif // wxUSE_MENUS

And the minimal application is actually working as it should!
No double Help menus, and a working OnAbout!

I cannot see what the difference is, can somebody explain?

Bengt Nilsson

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )