> Hi!
> I have the following question:
> when, starting from FLUID, I want to introduce an icon in a button, the s=
> elf=20
> generated code give me the following structure:
>
> =2E......
> #include <FL/Fl_Pixmap.H>
> =2E......
>
> unsigned char *icon_name[ // Decoded picture...
> (unsigned char*)
> "24 22 -251 1",
> (unsigned char*)
> "!\376""31\"\261\247\250#\316\316\322$\255\1\0%\224\1\1&\201\0\0\'\346;;(=
> \307\
> \304\307)\241ij*
> =2E.....................];
> static Fl_Pixmap pixmap_icon_name(icone_name);
> =2E........
> pixmap_icon_name.label(close_button);
> =2E........
>
> Is there a simpler way to introduce the "/path/icon_name.gif" icon in the=
> =20
> button? I don't want to generate these long arrays.
> I'm now using the old 0.17 version of flnx (FLTK for Microwindows), but I=
> =20
> think it is not a problem...
> Thank you in advance.
> Gianluca
>
// include this file
#include <FL/Fl_GIF_Image.H>
// defines image - note on MS WinXP pathname
Fl_GIF_Image *MyIcon = new Fl_GIF_Image("c:\\Mygraphics.gif");
// define a button
Fl_Button button = new Fl_Button(0,0,30,30,"");
// place icon on button - use 'button->align(FL_ALIGN_xxxx)'
// where xxxx is RIGHT, CENTER, LEFT, etc.
button->image(MyIcon);
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk