Re: Getting an X11 Window associated with a Gtk widget



On Wed, Jan 22, 2003 at 11:40:41PM +0800, Peter F Bradshaw wrote:
> > There is already a macro defined that will do this for you:
> >
> > #include <gdk/gdkx.h>
> >
> > win = GDK_WINDOW_XWINDOW(widget->window);
> 
> Tried that. Unfortunately it returns 0 after the widget has sent a
> realize signal (at which time I assume the xid would be valid).
> 

If widget->window != NULL, then GDK_WINDOW_XWINDOW(widget->window)
will definitely return a real X window. You can't have a GdkWindow
that lacks an X window. widget->window is always non-NULL if the
widget is realized.

(Basically, I think there's a bug somewhere - I would guess in your
test case, as I've never seen this issue reported against GTK.)

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]