Re: [gtk-list] Getting the X display from a GTK window



Mihai Christodorescu wrote:

> Hi!
>
>         I have a main window, and I want to find out the Display structure the
> program is running on, and the screen it is running on (the Display *
> representing the display and the integer representing the screen number).
>         I dug out a macro called GDK_WINDOW_XDISPLAY which seems to take a
> GdkWindow and return a Display *. Now the problem is that I do not know how
> to extract the GdkWindow out of a GtkWidget. More specifically, I have a
> GtkWindow.
>         My questions:
> 1. how do I get the GdkWindow from a GtkWidget?
> 2. how do I get the Display * from a GtkWidget or a GdkWindow (if the above
> macro does not work)?
> 3. how do I get the screen number from a GtkWidget?
>
> TIA,
>
> Mihai
>
> --
>  Mihai Christodorescu <mihai@cs.ucsb.edu> - TBP VP - ACM chair
> ---------------------------------------------------------------
> | Nagler's Comments on Murphy's Law: "Murphy's Law was not propounded by
> | Murphy, but by another man of the same name."
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null

1. widget->window
2. as you said, it works : display = GDK_WINDOW_XDISPLAY (widget->window)
3. (not sure) DefaultScreen (display)

Hope it's correct. Please correct if not :-)

Happy new year

Patrick



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