Subject: | suggest Window new_from_id |
Date: | Tue, 21 Apr 2009 08:16:54 +1000 |
To: | bug-X11-Motif [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
It'd be good to have some way to make an X::Window object from a given
integer ID. It'd be used when getting an id on the command line, like
xwininfo, or when inter-working with Gtk.
--- Lib.pm.orig 1998-07-11 01:22:56.000000000 +1000
+++ Lib.pm 2009-04-19 11:15:54.000000000 +1000
@@ -114,7 +114,16 @@
return ($_[0] == 1 || $_[0] =~ /^-?true$/i) ? 1 : 0;
}
+package X::ID;
+sub new_from_id {
+ my ($class, $xid) = @_;
+ # same in typemap T_X_ID
+ return bless \$xid, $class;
+}
+
package X::Drawable;
+ use vars qw(@ISA);
+ @ISA = qw(X::ID);
# Windows and Pixmaps are both Drawables so any function
# taking a Drawable can take one of these. (Perl checks