Re: XForms: XL_ObjWin

Trent Piepho (xyzzy@u.washington.edu)
Thu, 12 Nov 1998 17:51:35 -0800 (PST)

# To subscribers of the xforms list from Trent Piepho <xyzzy@u.washington.edu> :

On Thu, 12 Nov 1998, Steve Lamont wrote:
> # To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :
> > And how about this one:
> >
> > mag_left_pixmap=XCreatePixmap(FL_ObjWin(fd_xfmag->magleftpixmap,
> > SIZE,SIZE,8);
> >
> > gives me a BadWindow ID!
> >
> > I am getting quite fed up with the FL_ObjWin() problems I've been getting
> > - just read all of my previous emails and I'm sure you'll get my point. Is
> > there any other way of retrieving the Window ID for my Pixmap objects?
>
> I am getting quite fed up with you not listening to advice, too. I
> mentioned in a previous email that FL_ObjWin() returns the Window XID
> of the *form* not the Canvas (which is what I presume
> `fd_xfmag->magleftpixmap' points to).

It should still return a valid window ID, of the form the pixmap is in.
XCreatePixmap only uses the Drawable argument to determine which screen to put
the pixmap on. Finding the window ID of the form the pixmap is in seems like
the best way to get this information.

If the original poster is getting BadDrawable errors on th XCreatePixmap call,
prehaps FL_ObjWin() is being called before the form is shown?

> To get the XID of the Canvas use the function fl_get_canvas_id().

This is from the online manual:

To obtain the window ID of a canvas, use the following routine

Window fl_get_canvas_id(FL_OBJECT *ob)

or use the generic function(macro) (recommended)

Window FL_ObjWin(FL_OBJECT *ob)

So it seems that using FL_ObjWin() is the recommended way of getting the window
ID of a canvas.

|Gazing up to the breeze of the heavens \ on a quest, meaning, reason |
|came to be, how it begun \ all alone in the family of the sun |
|curiosity teasing everyone \ on our home, third stone from the sun. |
|Trent Piepho (xyzzy@u.washington.edu) -- Metallica |
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/