On Thu, 23 Oct 2008, MacArthur, Ian (SELEX GALILEO, UK) wrote:

> Perhaps you should look at how the sudoku example in the test folder is
> built, and see how the icon is set, and copy that.

Something along these lines worked for me:

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/x.H> 
#include <X11/xpm.h> 
#include <icon.xpm> // your icon file

Fl_Window *window = ui.make_window();

#ifdef WINDOWS
         // may not be needed
        window->icon((char 
*)LoadIcon(fl_display,MAKEINTRESOURCE(IDI_ICON1)));
#else
         Pixmap p, mask;

XpmCreatePixmapFromData(fl_display,DefaultRootWindow(fl_display),(char 
**)hd24connect_xpm, &p, &mask, NULL);

        window->icon((char *)p);
#endif

        window->end();
        window->show();

Remember to include -lXpm as compiler option, otherwise it won't work.

What I haven't managed yet, however, is to have transparency as well.
Using a stolen mozilla icon with transparent parts set to color 'None',
the supposed-to-be-transparent background shows up black.

Any ideas?

Marc

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

Reply via email to