Re: GtkAssistant - the 'apply' signal not working?
| From: | kksou | Date: | Wed, 04 Jul 2007 09:56:07 +0000 |
| Subject: | Re: GtkAssistant - the 'apply' signal not working? | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-7961@lists.php.net to get a copy of this message | ||
Marc Quinton-2 wrote:
> 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.
>
If you try the example:
http://www.kksou.com/php-gtk2/articles/set-up-wizards-using-GtkAssistant---Part-2---respond-to-forward-button.php
In Step 1, there are two GtkEntry fields. The problem with using signal
'prepare' is that it's triggered only just before Step 2 is displayed. At
this point in time, Step 1 has already being replaced. So there's no way we
can retrieve the values of the two entry fields with the signal 'prepare'.
We need the 'apply' signal because it's being triggered before the existing
page is being replaced by the next page.
Marc Quinton-2 wrote:
> 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 totally agree with you. The data structure used by GtkAssistant in setting
up each page should be improved, and probably wrapped in a class.
By the way, I just wrote another sample code that implements all the
functionalities of GtkAssistant using plain old GtkDialog.
http://www.kksou.com/php-gtk2/articles/set-up-wizards-using-GtkDialog---Part-1.php
The use of GtkDialog (as oppose to GtkAssistant) gives us controls of every
widget in it. I believe with this it's possible to wrap the setting up of
wizards into more intuitive classes and methods as you've suggested.
Regards,
/kksou
--
View this message in context: http://www.nabble.com/GtkAssistant---the-%27apply%27-signal-not-working--tf4016521.html#a11428117
Sent from the Php - GTK - General mailing list archive at Nabble.com.