XForms: pixmap question

Eric Mao (ericmao@leland.Stanford.EDU)
Wed, 7 Apr 1999 02:43:09 -0700 (PDT)

# To subscribers of the xforms list from Eric Mao <ericmao@leland.Stanford.EDU> :

Hi all,

I'm having some trouble getting pixmaps to display. When my form is not
visible and I try to use fl_set_pixmap_pixmap, I get:

X Error of failed request: BadDrawable (invalid Pixmap or Window parameter)
Major opcode of failed request: 55 (X_CreateGC)
Resource id in failed request: 0x0
Serial number of failed request: 93
Current serial number in output stream: 95

Any idea what I'm doing wrong? The relevant code is pasted in below.

Thanks in advance,
Eric Mao

#include <forms.h>
#include <stdlib.h>
#include "smallBlock.xpm"

int main(int argc, char *argv[])
{
unsigned int width, height;
Pixmap pixId;
FL_FORM *form1;
FL_OBJECT *pixmap;

fl_initialize(&argc, argv, 0, 0, 0);

pixId = fl_create_from_pixmapdata(fl_default_window(), smallBlock,
&width, &height, 0, NULL, NULL, 0);
form1 = fl_bgn_form(FL_NO_BOX, 200, 200);
fl_add_box(FL_FLAT_BOX,0,0,200,200,"");
pixmap = fl_add_pixmap(FL_NORMAL_PIXMAP, 0, 0, 8, 8, "");
fl_set_pixmap_pixmap(pixmap, pixId, 0);
fl_end_form();

fl_show_form(form1, FL_PLACE_CENTERFREE, FL_FULLBORDER,"Form 1");
fl_do_forms();
return 0;
}

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/