Toolbar problem Topic is solved

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
Inestical
In need of some credit
In need of some credit
Posts: 3
Joined: Sun Feb 18, 2007 6:14 pm
Location: System32

Toolbar problem

Post by Inestical »

Gah.. not sure what I'm doing wrong..

using wxWidgets 2.8.0 stable version

no matching function for call to `wxToolBar::AddTool(int, const char[1], wxBitmap*&, const char[1], wxItemKind)'

Code: Select all

...
    wxBitmap* icoNew = new wxBitmap(new_xpm);
    icoNew->Create(16, 16, 32);
    wxToolBar* tbrEdit = CreateToolBar();
    tbrEdit->SetToolBitmapSize(wxSize(16, 16));
    tbrEdit->AddTool(0, wxT(""), icoNew, wxT(""), wxITEM_NORMAL);
    tbrEdit->Realize();
    SetToolBar(tbrEdit);
...
Randomness to the end 0.o
benedicte
wxWorld Domination!
wxWorld Domination!
Posts: 1409
Joined: Wed Jan 19, 2005 3:44 pm
Location: Paris, France

Post by benedicte »

1/ The "icoNew" parameter is a pointer on wxBitmap .... The "AddTool" function expects a "const wxBitmap&".
2/ The fourth parameter is also a "const wxBitmap&"... if you do not have one, use the "wxNullBitmap" constant.

Try this call:

Code: Select all

tbrEdit->AddTool(0, wxT(""), *icoNew, wxNullBitmap, wxITEM_NORMAL);
// or simply 
tbrEdit->AddTool(0, wxT(""), *icoNew);
Post Reply