Re: How to get the Class name of an element
- From: Dave Hayes <dave jetcafe org>
- To: Pelle Nilsson <pellenilsson fastmail fm>
- Cc: gtk-perl-list gnome org
- Subject: Re: How to get the Class name of an element
- Date: Fri, 16 Apr 2010 12:16:24 -0700
Pelle Nilsson <pellenilsson fastmail fm> writes:
if (substr($text, 0, 11) eq 'Gtk2::Entry') {
print "Entry!\n";
} elsif (substr($text, 0, 14) eq 'Gtk2::ComboBox') {
print "ComboBox!\n";
}
This might be better written as
if (ref($text) eq 'Gtk2::Entry') {
...
:)
--
Dave Hayes - Consultant - Altadena CA, USA - dave jetcafe org
The opinions expressed above are entirely my own <<<
"That's a very dangerous lake, Nasrudin. People who swim in
it are always being found dead at the bottom."
"That's alright, friend", replied Nasrudin. "I'll keep well
away from the bottom..."
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]