Re: To do somenthin knowing the type of the widget
| From: | Robertico | Date: | Tue, 21 Aug 2007 00:14:43 +0000 |
| Subject: | Re: To do somenthin knowing the type of the widget | ||
| References: | 1 2 3 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-8048@lists.php.net to get a copy of this message | ||
0k, yes, thank you Bob and diego,both answers are what I need. Sorry if it
was seally, I always have programed on structured php and didn't know it,
it's a totally new way for me, but I really like php-gtk as little as know.
Thanks a lot.
2007/8/20, Diego Feitosa <diego@dnfeitosa.com>:
>
> 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:
> >> 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!!
> >>
> >
>
> --
> Diego Feitosa
> www.dnfeitosa.com <http://www.dnfeitosa.com>
>
>
>
--
L.I. Roberto Carlos Bárcenas Adame.
roberto.barcenas@gmail.com
Tel. 57949690 (Recados)
================
("
-''-/").___..--''"-._
6_ 6 ) -. ( ).-.__.)
(_Y_.)' ._ ) ._ . ``-..-'
_..`--'_..-_/ /--'_.' ,'
(il),-'' (li),' ((!.-'
Por mí raza hablará el espíritu...
======================