On Fri, May 8, 2009 at 7:20 AM, Michael Losh <[email protected]> wrote:
> ..
>> Pixmap p, mask;
>> p = 0;
>> XpmAttributes xpm_attributes;
>> int rc = XpmCreatePixmapFromData(fl_display, RootWindow(fl_display, 
>> fl_screen),  (char **)f_image_xpm, &p, &mask, &xpm_attributes);
>> printf("p after creating pixmap is 0x%08X, rc from XpmCreatePixmapFromData() 
>> is %d\n", p, rc);
>>
>>
>> When my app runs, on the console I see:
>>
>> X_AllocColor: BadColor (invalid Colormap parameter) 0x78c38
>> p after creating pixmap is 0x00000000, rc from XpmCreatePixmapFromData() is 
>> -4
>>
> ..
>> This app is running in a JWM (Joe's Window Manager) session on XVESA with a 
>> color depth of 32.  Any troubleshooting help would be much appreciated!
>
> A few more details.... the problem described above is when using FLTK 1.1.9 
> and libXpm as included in TinyCore Linux version 1.3.  I tried the recommend 
> code to set the window icon in Fedora 7, and it works!  (Notwithstanding the 
> much-discussed background transparency issue).
>
> Maybe there is a problem with the libXpm as included in TC v. 1.3?  I can 
> create Fl_XPM_Image objects and see them in my app window, so at least some 
> of libXpm is working.  Again, any troubleshooting help would be appreciated!
> _______________________________________________
> fltk mailing list
> [email protected]
> http://lists.easysw.com/mailman/listinfo/fltk
>

This is how I do it for my application. Hope it helps.

#include <X11/xpm.h>
#include <X11/Xutil.h>
#include "applered.xpm"

    NameWindow nwin(630, 710);

    Pixmap p, mask;
    XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display),
                                    apple_red_xpm, &p, &mask, NULL);

    nwin.icon((char *)p);

    Fl::visual(FL_DOUBLE|FL_INDEX);
    nwin.show();

    XWMHints* hints = XGetWMHints(fl_display,
fl_xid(reinterpret_cast<Fl_Window*>(&nwin)));
    hints->flags |= IconMaskHint;
    hints->icon_mask = mask;
    XSetWMHints(fl_display, fl_xid(reinterpret_cast<Fl_Window*>(&nwin)), hints);
    XFree(hints);

    nwin.show();




-- 
Robert Arkiletian
Eric Hamber Secondary, Vancouver, Canada

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

Reply via email to