Re: How To Set Tab Order
| From: | Scott Mattocks | Date: | Mon, 23 Aug 2004 17:43:36 +0000 |
| Subject: | Re: How To Set Tab Order | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-4984@lists.php.net to get a copy of this message | ||
dpgirago@mdanderson.org wrote:
I can use set_focus() on a GtkEntry() widget to have focus when an application is launched. But how do I customize which widget would next receive focus, say from hitting the tab button?I don't know if there is a built in way to do it but you could wrap your containing widget in a class that could handle if for you: class MyContainer { var $widget; var $children; var $curChild; function MyClass() { $this->widget =& new GtkSomeContainer(); $this->widget->connect('some-event', array(&$this, 'nextChild')); } function nextChild() { if (++$this->curChild > count($this->children)) { $this->curChild = 0; } $this->children[$this->curChild]->grab_focus(); } } $myObject =& new MyClass(); $myObject->widget->add(new GtkEntry()); ... Scott Mattocks