I want to use the default wxArtProvider to fill the tools on a wxToolBar with icons as provided by the system.
This is the code I came up with (minimal example):
Code: Select all
#include <wx/wx.h>
#include <wx/artprov.h>
#include <wx/sysopt.h>
class App : public wxApp {
virtual bool OnInit() {
wxSystemOptions::SetOption("msw.remap", 2); // according to http://docs.wxwidgets.org/trunk/classwx_tool_bar.html
wxFrame *frame = new wxFrame(NULL, wxID_ANY, "Transparencytest");
wxToolBar* toolBar = frame->CreateToolBar(wxTB_HORIZONTAL, wxID_ANY);
toolBar->AddTool(wxID_ANY, wxT("&Open"), wxArtProvider::GetBitmap(wxART_FOLDER_OPEN, wxART_TOOLBAR));
toolBar->Realize();
frame->Show(true);
return true;
}
};
wxIMPLEMENT_APP(App);
I am on Windows 10, building against wxWidgets 3.1.1 with TGM GCC 5.1.0 (64bit). Using pre-compiled DLLs or linking against static libraries I compiled myself makes no difference.
On Ubuntu 16.04, building against wxWidgets 3.0.2 (GTK2), the toolbar looks perfectly fine (with transparency).
Various other forum topics
viewtopic.php?f=1&t=1932
viewtopic.php?f=1&t=40485
viewtopic.php?f=1&t=23160
viewtopic.php?f=23&t=10686
mention this issue with (embedded) PNGs, but I am not using custom embedded images.
What am I missing here?
Kind Regards