Hello,
I try to set my own application window icon under linux with fltk2-r6525.
This is my test program:
#include <fltk/Window.h>
#include <fltk/run.h>
#include <fltk/x.h>
#include <X11/xpm.h>
#include "logo_bg.xpm"
using namespace fltk;
Pixmap global_icon;
Pixmap global_mask;
int main(int argc, char **argv)
{
Window *window = new Window(470, 150, "App Icon Test");
// Create child widgets
window->end();
fltk::open_display();
XpmCreatePixmapFromData(fltk::xdisplay,
DefaultRootWindow(fltk::xdisplay),
(char**)logo_bg_xpm,
&global_icon, &global_mask, NULL);
window->icon((char*)global_icon);
window->show(argc, argv);
run();
return (0);
}
I compile it with:
g++ -g -I<path>/fltk-2.0.x-r6525 -o app_icon app_icon.cxx
-L<path>fltk-2.0.x-r6525/lib <path>/fltk-2.0.x-r6525/lib/libfltk2.a
<path>/fltk-2.0.x-r6525/lib/libfltk2_images.a -L/usr/local/lib -lXi -lXinerama
-lXft -lXpm
But when I run this little program I get a segmentation fault. Here is what the
debugger said:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1213376816 (LWP 17466)]
0x08050dea in fltk::CreatedWindow::create ()
(gdb) where
#0 0x08050dea in fltk::CreatedWindow::create ()
#1 0x0805105b in fltk::Window::create ()
#2 0x0805ae9b in fltk::Window::show ()
#3 0x0804b79f in fltk::Window::show ()
#4 0x0804b35e in main (argc=1, argv=0xbfa400b4) at app_icon.cxx:31
Has anyone a idea what I made wrong?
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk