Re: Getting an X11 Window associated with a Gtk widget
- From: Havoc Pennington <hp redhat com>
- To: Peter F Bradshaw <pfb exadios com>
- Cc: gtk-list gnome org
- Subject: Re: Getting an X11 Window associated with a Gtk widget
- Date: Thu, 23 Jan 2003 01:38:53 -0500
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]