Forum: Ruby-Gnome 2 GTK xwindows id

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Erwan Masson (Guest)
on 2007-06-21 12:45
(Received via mailing list)
Hello,
 I would like to grab the x windows id to a GTK Drawing Area object. I
have
seen that is possible to do that easily in python, but I am not be able
to
retrieve this info on ruby.
In Python I can grab like this : myDrawingAreaObject.window.xid
Can somone has an idea please?
Thanks for help,
Erwan Masson
Masao M. (Guest)
on 2007-06-21 19:05
(Received via mailing list)
Hi,

On Thu, 21 Jun 2007 10:45:13 +0200
"Erwan Masson" <removed_email_address@domain.invalid> wrote:

> Hello,
>  I would like to grab the x windows id to a GTK Drawing Area object. I have
> seen that is possible to do that easily in python, but I am not be able to
> retrieve this info on ruby.
> In Python I can grab like this : myDrawingAreaObject.window.xid
> Can somone has an idea please?

If you compile Ruby-GNOME2 on X11(not Windows), there is a
Gdk::Drawable#xid.

Here is a sample:

require 'gtk2'
win = Gtk::Window.new
draw = Gtk::DrawingArea.new
win.add draw
win.show_all  # or realize draw.
p draw.window.xid

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
This topic is locked and can not be replied to.