wxToolbar without buttons on mac

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Kenneth Camargo
Experienced Solver
Experienced Solver
Posts: 64
Joined: Tue Sep 11, 2007 6:02 pm
Location: Brazil

wxToolbar without buttons on mac

Post by Kenneth Camargo » Wed Feb 13, 2013 12:39 am

I am trying to build an application that I already have running under Linux and Windows (Ubuntu for several versions since 9.12, Windows since XP, in both cases 32 and 64 bit versions). I managed to build it without problems with wxWidgets 2.9.4 under Ubuntu 12.10 64 bits.
Under MacOSX Mountain Lion I got the application to build using the xcode command line tools, but the buttons in the toolbar do not show.
The relevant bit (generated with code::blocks wxSmith, and then edited) follows:

Code: Select all

ToolBar1 = new wxToolBar(this, ID_TOOLBAR1, wxDefaultPosition, wxDefaultSize, wxTB_HORIZONTAL|wxTB_TOP|wxNO_BORDER, _T("ID_TOOLBAR1"));
    ToolBarItem1 = ToolBar1->AddTool(ID_TOOLBARITEM1, _("Open"), wxBitmap(database_connect), wxNullBitmap, wxITEM_NORMAL, _("Open database"), wxEmptyString);
    ToolBarItem2 = ToolBar1->AddTool(ID_TOOLBARITEM2, _("New"), wxBitmap(database_add), wxNullBitmap, wxITEM_NORMAL, _("New database"), wxEmptyString);
    ToolBarItem3 = ToolBar1->AddTool(ID_TOOLBARITEM3, _("Backup"), wxBitmap(package), wxNullBitmap, wxITEM_NORMAL, _("Make backup of all databases"), wxEmptyString);
    ToolBarItem4 = ToolBar1->AddTool(ID_TOOLBARITEM4, _("Restore"), wxBitmap(package_go), wxNullBitmap, wxITEM_NORMAL, _("Restore saved databases"), wxEmptyString);
    ToolBarItem5 = ToolBar1->AddTool(ID_TOOLBARITEM5, _("Remove"), wxBitmap(database_delete), wxNullBitmap, wxITEM_NORMAL, _("Remove database"), wxEmptyString);
    ToolBar1->AddSeparator();
    ToolBarItem6 = ToolBar1->AddTool(ID_TOOLBARITEM6, _("About"), wxBitmap(information), wxNullBitmap, wxITEM_NORMAL, _("About the program"), wxEmptyString);
    ToolBar1->AddSeparator();
    ToolBarItem7 = ToolBar1->AddTool(ID_TOOLBARITEM7, _("Quit"), wxBitmap(door_in), wxNullBitmap, wxITEM_NORMAL, _("End the program"), wxEmptyString);
    ToolBar1->Realize();
    SetToolBar(ToolBar1);
The arguments to create the wxBitmaps are char arrays of xpm files that have been previously #included in the source.

Any help will be greatly appreciated.
Thanks in advance,
Ken
Using gcc 4.7.2 (mainly), wxWidgets 2.8.12 & 2.9.4, Ubuntu 12.10 (32 bits and 64 bits), win xp (32 bits), win 7 (64 bits), trying to get a hand on Mac OSX Mountain Lion, code::blocks

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Re: wxToolbar without buttons on mac

Post by Auria » Mon Feb 18, 2013 12:28 am

is it wxOSX/Carbon or wxOSX/Cocoa ? The latter does it just fine for me
"Keyboard not detected. Press F1 to continue"
-- Windows

Post Reply