> I have a sample code that crashes when the icon is loaded.
> The icon is a multicolored icon of 32x32.
>
>
> #include <fltk/x11.h>
> #include <fltk/run.h>
> #include <fltk/Window.h>
> #include <X11/xpm.h>
> #include "../icons/viewer.xpm"
>
> int main( int argc, char** argv )
> {
>
> fltk::Window window( 120, 220 );
>
> fltk::open_display(); // needed if display has not been previously opened
>
> Pixmap p, mask;
>
> if ( XpmCreatePixmapFromData(fltk::xdisplay,
> DefaultRootWindow(fltk::xdisplay),
> viewer_xpm,
> &p, &mask, NULL) == XpmSuccess )
> {
> // uncomment to crash program
> //window.icon((char *)p);
> }
>
> window.show( );
> fltk::run();
> }
>
window must be shown before setting the icon.
Jacques Senecal.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk