I would like to have a button that displayes bitmap image and text so I'm using wxBitmapToggleButton. Under Ubuntu 22.04 only bitmap shows up on the button the text label doesn't show up. Under Windows 10 both bitmap and text label show up on the button. I've narroed it down to wxHAS_BITMAPTOGGLEBUTTON not being defined under Ubuntu. I'm thinking it's a configuration issue but I cannot spot it. Any help would be appreciated. I'm using latest wxWidgets 3.2 release from https://docs.codelite.org/wxWidgets/repo321/
Code: Select all
std::unique_ptr<wxImage> img;
img.reset(new wxImage(myIcon1, wxBITMAP_TYPE_PNG));
img->Rescale(32, 32);
int btnIndex = ID_BUTTON_BASE_PLAY + buttonIndex++;
wxBitmapToggleButton* button = new wxBitmapToggleButton(this, btnIndex, wxBitmapBundle(*img.get()), wxPoint(0, 0), wxSize(180, 36));
button->SetLabel("Some Button Label");
Code: Select all
APP:= my-desktop-app
CXX:= g++
LIB_INSTALL_DIR?=./
APP_INSTALL_DIR?=./
SRCS:= $(wildcard *.cpp)
INCS:= $(wildcard *.h)
PKGS:= json-glib-1.0 gtk+-3.0
OBJS:= $(SRCS:.cpp=.o)
CFLAGS+= `pkg-config --cflags $(PKGS)`
CFLAGS+= `wx-config --cxxflags`
#CFLAGS+= -I/usr/include/wx-3.0 -I/usr/lib/x86_64-linux-gnu/wx/include/gtk3-unicode-3.0
WX_CXXFLAGS = $(shell wx-config --cxxflags)
#CFLAGS+= ${WX_CXXFLAGS}
LIBS:= `pkg-config --libs $(PKGS)`
WX_LIBS = $(shell wx-config --libs)
#LIBS+= ${WX_LIBS}
LIBS+= `wx-config --libs html,adv,core,xml,base`
LIBS+= -L$(LIB_INSTALL_DIR) -lpthread -Wl,-rpath,$(LIB_INSTALL_DIR)
all: $(APP)
%.o: %.cpp $(INCS) Makefile
$(CXX) -c -o $@ $(CFLAGS) $<
$(APP): $(OBJS) Makefile
$(CXX) -o $(APP) $(OBJS) $(LIBS)
clean:
rm -rf $(OBJS) $(APP)