Newbie question: I don't understand Glade...

View: New views
2 Messages — Rating Filter:   Alert me  

Newbie question: I don't understand Glade...

by Massimiliano Scaletti :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I created a form with Glade, I've loaded it and It's shown correcly.
How can I access values in the widgets inside the gtkWindow?
I tried with this code:
         ...
        $frmAnagrafica=$glAnagrafica->get_widget('frmAnagrafica');    
//gtkWindow
        $glAnagrafica->signal_autoconnect_instance($this);
        $frmAnagrafica->txt_ragsoc->set_text('Test'); //class: gtkEntry  
name: txt_ragsoc <- without this the form it's shown and the signls are
correctly attached...
        ...
I receive the error: Call to a member function set_text() on a
non-object in...

Why?
The objet tree in the window is:
frmAnagrafica
    |
    +--vBox1
             |
             +--hBox1
                      |
                      +--txt_ragsoc

Thanks
Massimiliano

--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: Newbie question: I don't understand Glade...

by Kasper Johansen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Massimiliano Scaletti wrote:

> I created a form with Glade, I've loaded it and It's shown correcly.
> How can I access values in the widgets inside the gtkWindow?
> I tried with this code:         ...
>        $frmAnagrafica=$glAnagrafica->get_widget('frmAnagrafica');    
> //gtkWindow
>        $glAnagrafica->signal_autoconnect_instance($this);
>        $frmAnagrafica->txt_ragsoc->set_text('Test'); //class:
> gtkEntry  name: txt_ragsoc <- without this the form it's shown and the
> signls are correctly attached...
>        ...
> I receive the error: Call to a member function set_text() on a
> non-object in...
I think this will work for you, if you have given the text-widget the
name "txt_ragsoc" in Glade:
$frmAnagrafica->get_widget("txt_ragsoc")->set_text("Test");


--
Med venlig hilsen
Kasper Johansen


--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php