Re: How to get the Class name of an element
- From: Emmanuele Bassi <ebassi gmail com>
- To: gtk-perl-list gnome org
- Subject: Re: How to get the Class name of an element
- Date: Fri, 16 Apr 2010 12:25:54 +0100
On Fri, 2010-04-16 at 12:59 +0200, Pelle Nilsson wrote:
If an object is used in a string context it will return something like
Gtk2::Entry=HASH(0x12cfba8)
so you can use something like
if (substr($text, 0, 11) eq 'Gtk2::Entry') {
print "Entry!\n";
} elsif (substr($text, 0, 14) eq 'Gtk2::ComboBox') {
print "ComboBox!\n";
}
oh dear god, no: please, no.
'perldoc UNIVERSAL' to you too.
ciao,
Emmanuele.
--
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]