Re: Obtaining widget info



Guillaume Cottenceau <gc mandrakesoft com> writes:

print "widget is $what\n";

Hum, sorry, $widget of course. Say, for example:

[gc obiwan /tmp] perl -e 'use Gtk; Gtk->init; $b = Gtk::Button->new(); print "b is $b\n"'
b is Gtk::Button=HASH(0x804c124)

Or if you need to know the type in perl :

[gc obiwan /tmp] perl -e 'use Gtk; Gtk->init; $b = Gtk::Button->new(); print "button : ", 
$b->isa('Gtk::Button'), "\n"'
button : 1
[gc obiwan /tmp] perl -e 'use Gtk; Gtk->init; $b = Gtk::Button->new(); print "widget : ", 
$b->isa('Gtk::Widget'), "\n"'
widget : 1
[gc obiwan /tmp] perl -e 'use Gtk; Gtk->init; $b = Gtk::Button->new(); print "box : ", $b->isa('Gtk::Box'), 
"\n"'
box : 

Check the archives if you need a call that don't fail when $b is
not an object.

-- 
Guillaume Cottenceau - http://people.mandrakesoft.com/~gc/



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