wxButton SetBitmap not affect on another linux box Topic is solved
wxButton SetBitmap not affect on another linux box
Hi, all
I use wxButton.SetBitmap (wxBitmap(a_char_poinrt_to_xpm), wxTOP) to set the bitmap for a wxButton, it can be showing on Debian 8.04. But on another linux box (Raspbian on an rpi), it can't show bitmap. Label showing is correct.
On both platform, I install libwxgtk3.0-dev package to compile the application.
I don't known the relation between wxWidgets and GTK+. It seems there is no wxWidgets packet alone on debian.
Raspbian was based on debian, BTW.
Thanks.
I use wxButton.SetBitmap (wxBitmap(a_char_poinrt_to_xpm), wxTOP) to set the bitmap for a wxButton, it can be showing on Debian 8.04. But on another linux box (Raspbian on an rpi), it can't show bitmap. Label showing is correct.
On both platform, I install libwxgtk3.0-dev package to compile the application.
I don't known the relation between wxWidgets and GTK+. It seems there is no wxWidgets packet alone on debian.
Raspbian was based on debian, BTW.
Thanks.
Re: wxButton SetBitmap not affect on another linux box
Hi,
If that's unhelpful, have a look at the wx samples. On debian that means installing the wx3.0-examples package. It installs to /usr/share/doc/wx-examples/. There's also a script there to decompress and build them.
Several of the samples use 'sample.xpm'. Does it work in one of them e.g. 'minimal'?
Regards,
David
On Linux, by default wxWidgets uses gtk+ as its native API. That's why the packages tend to be called libwxgtk*.deb or wxGTK*.rpm.I don't known the relation between wxWidgets and GTK+
Perhaps xpm is a type of bitmap that your raspbian install can't handle. Try switching to a different type e.g. png instead of xpm.But on another linux box (Raspbian on an rpi), it can't show bitmap.
If that's unhelpful, have a look at the wx samples. On debian that means installing the wx3.0-examples package. It installs to /usr/share/doc/wx-examples/. There's also a script there to decompress and build them.
Several of the samples use 'sample.xpm'. Does it work in one of them e.g. 'minimal'?
Regards,
David
Re: wxButton SetBitmap not affect on another linux box
I compile the example minimal, and the icon can't show, too.
I installed the package graphicsmagick-imagemagick-compat, it can translate a png to xpm by command convert. but the minimal icon not show....
maybe I should install a fresh debian environment to test it later.
I installed the package graphicsmagick-imagemagick-compat, it can translate a png to xpm by command convert. but the minimal icon not show....
maybe I should install a fresh debian environment to test it later.
Re: wxButton SetBitmap not affect on another linux box
One thing to do is to see if your wxWidgets was compiled with xpm support. To do that, look inside /usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0/wx/setup.h (for a 64bit wx).
Mine contains:
#define wxUSE_XPM 1
Mine contains:
#define wxUSE_XPM 1
Re: wxButton SetBitmap not affect on another linux box
I find two setup.h on both linux boxes. the contents are same:
/usr/lib/.../wx/include/base-unicode-3.0/wx/setup.h
#define wxUSE_XPM 0
/usr/lib/.../wx/include/gtk2-unicode-3.0/wx directory.
#define wxUSE_XPM 1
In my Makefile:
CXX = `wx-config --cxx`
LIBS=`wx-config --libs`
CXXFLAGS=`wx-config --cflags`
So I run wx-config --cflags --libs on two boxes, and they are same too.
box1:
-I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread
-I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0: No such file or directory
pi@raspberrypi:~ $ -L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
box2:
-I/usr/lib/arm-linux-gnueabihf/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread
-L/usr/lib/arm-linux-gnueabihf -pthread -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
/usr/lib/.../wx/include/base-unicode-3.0/wx/setup.h
#define wxUSE_XPM 0
/usr/lib/.../wx/include/gtk2-unicode-3.0/wx directory.
#define wxUSE_XPM 1
In my Makefile:
CXX = `wx-config --cxx`
LIBS=`wx-config --libs`
CXXFLAGS=`wx-config --cflags`
So I run wx-config --cflags --libs on two boxes, and they are same too.
box1:
-I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread
-I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0: No such file or directory
pi@raspberrypi:~ $ -L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
box2:
-I/usr/lib/arm-linux-gnueabihf/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread
-L/usr/lib/arm-linux-gnueabihf -pthread -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
Re: wxButton SetBitmap not affect on another linux box
So that isn't the cause. (wxBase is only used for non-gui programs, so its setup.h is supposed to have wxUSE_XPM 0.)
I presume you don't have any helpful error messages if you run the sample from a terminal. It might be worth trying installing the libwx debug packages and see if any messages appear.
If none do, then the next step would be to do a proper debug with gdb, ideally with a self-built wxGTK. However I would understand if you feel that would be too time-consuming in an rpi.
I presume you don't have any helpful error messages if you run the sample from a terminal. It might be worth trying installing the libwx debug packages and see if any messages appear.
If none do, then the next step would be to do a proper debug with gdb, ideally with a self-built wxGTK. However I would understand if you feel that would be too time-consuming in an rpi.
Re: wxButton SetBitmap not affect on another linux box
I installed a fresh Debian Jessie (not rpi), and there is no bitmap displayed, too.
I installed libwxgtk3.0-0-dbg too. only this message displayed when I run the prog.
It seems there is only debug way to find the problem.
I installed libwxgtk3.0-0-dbg too. only this message displayed when I run the prog.
It seems there is only debug way to find the problem.
Re: wxButton SetBitmap not affect on another linux box
But you originally said:I installed a fresh Debian Jessie (not rpi), and there is no bitmap displayed, too.
What is the difference between those two jessie installs?I use wxButton.SetBitmap (wxBitmap(a_char_poinrt_to_xpm), wxTOP) to set the bitmap for a wxButton, it can be showing on Debian 8.04.
Does the 'minimal' sample have an icon on both, or only on one?
What message was that?I installed libwxgtk3.0-0-dbg too. only this message displayed when I run the prog.
Re: wxButton SetBitmap not affect on another linux box
The two Debian Jessie are different of couse, but I don't known the detail of that. the First one I used for a long time, so maybe there are some packages installed already.
So the second fresh Debian Jessie was created and I'm using it to see if it is the problem occured on rpi only. And it's not the problem of rpi/raspbian obviously.
the program only show one msg:
Gtk-Message: Failed to load module "canberra-gtk-module"
It seems have no relation to bitmap.
So the second fresh Debian Jessie was created and I'm using it to see if it is the problem occured on rpi only. And it's not the problem of rpi/raspbian obviously.
the program only show one msg:
Gtk-Message: Failed to load module "canberra-gtk-module"
It seems have no relation to bitmap.
Re: wxButton SetBitmap not affect on another linux box
I see. You can easily save a list of the installed packages in an installation; see https://wiki.debian.org/ListInstalledPackages. Comparing the lists of the 2 installs should find the answer, along with a lot of irrelevant results.The two Debian Jessie are different of couse, but I don't known the detail of that. the First one I used for a long time, so maybe there are some packages installed already.
Re: wxButton SetBitmap not affect on another linux box
I just install another Jessie. This time I install KDE desktop, and find the Bitmap shows.
Before this, I install a lxde.
It seems that xpm bitmap function rely on KDE or alike advanced desktop environment.
Before this, I install a lxde.
It seems that xpm bitmap function rely on KDE or alike advanced desktop environment.
Re: wxButton SetBitmap not affect on another linux box
It's more likely that the missing library just happens to be one of kde's many dependencies.
FWIW I just checked a lubuntu zesty virtualbox guest. That has no problem displaying xpms, so it's not directly a lxde issue.
FWIW I just checked a lubuntu zesty virtualbox guest. That has no problem displaying xpms, so it's not directly a lxde issue.