Robert Arkiletian wrote:

> Pixmap p, mask;
> XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display),
> apple_red_xpm, &p, &mask, NULL);
> 
> nwin.icon((char *)p);

I was having problems with window icons too till I re-read the FLTK docs:


What I was missing as the fl_open_display(). I don't remember seeing that 
the first time I looked in this (1.1.7). I have since added and it appears 
to be working fine for me.

I use FLUID to create the main window, so in FLUID I add this code block 
before construction of the window. You can probably ignore the FL:: 
statements and the fl_register_images() though. I'm guessing they wont hurt 
if you add them too.



Fl::visual(FL_DOUBLE|FL_INDEX);
Fl::get_system_colors();
fl_register_images();
Fl::scheme("gtk+");

fl_open_display();

Pixmap p, mask;

// This sets the tiny icon in the upper left corner
XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display),
                        (char**)myicon_22_xpm, &p, &mask, NULL);



HTH,

Alvin

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to