Re: To do somenthin knowing the type of the widget
| From: | Diego Feitosa | Date: | Tue, 21 Aug 2007 00:04:28 +0000 |
| Subject: | Re: To do somenthin knowing the type of the widget | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-8047@lists.php.net to get a copy of this message | ||
Or even...
if ($widget instanceof GtkEntry) {
// do something} Bob Majdak Jr escreveu:
you are looking for get_class(object), which is part of the php standard library. <?php $widget = new GtkEntry; if(get_class($widget) == 'GtkEntry') { // do something } else { // do not do something } //. - bob ?> Robertico wrote:-- Diego Feitosa www.dnfeitosa.com <http://www.dnfeitosa.com>Hi, I am building some form using a for each loop to insert GtkEntry and GtkCombobox widgets in an array, then I want to to display the values of each widget. At this time I'm abble to know which type of widget is by the array position, but I wish to do it knowing the widget type. I mean if(widget_type == 'GtkEntry') do something else if(widget_type == 'GtkCombobox') do something What I looking for is the function to know which is the type!! Thanks in advance!!