Re: GtkAssistant - the 'apply' signal not working?
| From: | Marc Quinton | Date: | Wed, 04 Jul 2007 08:20:53 +0000 |
| Subject: | Re: GtkAssistant - the 'apply' signal not working? | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-7960@lists.php.net to get a copy of this message | ||
On 7/3/07, kksou <kksou@kksou.com> wrote:
... Also, the method set_forward_page_func() is not present in the beta release too.yes, when you have a look at log file after build, there is a message error about GtkAssistant function pointer :
method GtkAssistant::set_forward_page_func: unknown type'GtkAssistantPageFunc'
Without the signal 'apply' and the method set_forward_page_func(), it is difficult to set up a useful wizard because we have no way to know when the user clicks the forward button, on which page it is, and to retrieve a copy of the contents of the widgets that are present on that page.GtkAssistant should trigger 4 signals, but effectively "apply" signal is never triggered here too. For other signals, there is no problem.
Did I miss a step somewhere? Or are these really not existing in the beta release yet?you could registrer to "prepare" signal givin a callback with that form : function on_prepare($assistant, $page) { echo "signal prepare ...\n"; } no need to return a value ; it has not effect. This signal is triggered just before a page is shown and allow to fill page with some information. You can manage page order with this callback. For my point of view, I think it would be better to create some classes to create an assistant like feature, but with a better object orientation. There would be : - Assistant class managing some pages - Page class : - this is a container widget ; - you can add some child widget, - has a title, perhaps an icon, - could trigger an signal, I would be something like that : class Assistant { .... } class Page { # define signals, # a method telling when user input is OK : public function is_ok(){ return true; } } class PasswordPage extends Page{ # could override some methods here public function is_ok(){
if($this->passwd_entry->get_text() == 'foobar')
return true;
return false;
}
}
$assistant = new Assistant();
$assistant->add( $p1 = new Page('test me');
$p1->add($vbox = new Vbox());
$assistant->add( $p2 = new PasswordPage('password');
$p2->add($vbox = new Vbox());
$assistant->show_all()
$assistant->connect_simple('activate', ...);
$page->connect_simple('activate', ...);
...