Re: activate default using glade -- solution sorta
| From: | suomaf | Date: | Sat, 09 Sep 2006 08:39:02 +0000 |
| Subject: | Re: activate default using glade -- solution sorta | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-7241@lists.php.net to get a copy of this message | ||
-------------------------
php file anyname.php
-------------------------
<?php
class loginClass extends GtkWindow
{
function __construct()
{
parent::__construct();
$this->glade = new GladeXML(dirname(__FILE__) . '/o.glade');
$this->glade->signal_autoconnect_instance($this);
}
function entry_activate()
{
$this->button_clicked();
}
function button_clicked()
{
echo "here is something";
}
}
$myClassInstance = new loginClass();
//Start the main loop
Gtk::main()
?>
-------------------------
glade file o.glade
-------------------------
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<glade-interface>
<widget class="GtkWindow" id="window1">
<property name="visible">True</property>
<signal name="destroy" handler="gtk::main_quit"/>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<child>
<widget class="GtkEntry" id="entry1">
<property name="visible">True</property>
<signal name="activate" handler="entry_activate"/>
</widget>
<packing>
<property name="expand">False</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="label"
translatable="yes">button</property>
<signal name="clicked" handler="button_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>
kind regards,
suomaf
--
View this message in context: http://www.nabble.com/activate-default-using-glade-tf2242525.html#a6221693
Sent from the Php - GTK - General forum at Nabble.com.