XLib Advice Required...

Bogdan Iamandei (inorog@csit-sun.pub.ro)
Tue, 13 May 1997 20:15:44 +0300

To subscribers of the xforms list from Bogdan Iamandei <inorog@csit-sun.pub.ro> :

I tried to create a window which would have as parent the
Main_Wnd->Canvas object.... the window will be the future drawing board,
but it seems that I have done something wrong even if this was done
after the book ... Tho I am not so sure about the "border_width"
parameter... is it the cause of all or what? The message that my prog.
puts on the screen is "X Error of failed request: BadWindow (invalid
Window parameter)" - of course, but I couldn't figure out why.

Anyone, please, can tell me what is wrong here?

Main_Wnd->Drawing_Area_Group = fl_bgn_group();
Main_Wnd->Canvas = obj =
fl_add_canvas(FL_SCROLLED_CANVAS,150,149,840,611,"");
fl_add_canvas_handler(Main_Wnd->Canvas, Expose,
canvas_expose, Main_Wnd);

fl_add_canvas_handler(Main_Wnd->Canvas, ButtonPress,
canvas_button, Main_Wnd);

fl_add_canvas_handler(Main_Wnd->Canvas, ButtonRelease,
canvas_button, Main_Wnd);
canvas_GC = XCreateGC(fl_get_display(), fl_state[fl_vmode].trailblazer,
0,0);
XSetForeground(fl_get_display(), canvas_GC, fl_get_flcolor(FL_BLACK));

TEST = XCreateSimpleWindow(fl_get_display(), Main_Wnd->Canvas,
x,y,width,height, border_width,
BlackPixel(fl_get_display(),
DefaultScreen(fl_get_display())),
WhitePixel(fl_get_display(),
DefaultScreen(fl_get_display())));