On Fri, 2010-04-16 at 09:25 +0000, l...@guenther-sohler.net wrote:
> Its really a stupid question.

this is not good OOP.

if you feel the need to do a type check then you're probably doing the
wrong thing.

> If I write
> 
> $text=Gtk2::Entry->new;
> or
> $text=Gtk2::ComboBoxEntry->new;
> 
> how can I check later in the program if $text is an Entry or an
> ComboBoxEntry ?
> 
> if($text->get_text != undef)
> {
> }
> 
> does not help. It already tries to call an undefined function

you want UNIVERSA::isa

perldoc UNIVERSAL

ciao,
 Emmanuele.

-- 
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi

_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

Reply via email to