[Glade-users] gtk.assistant and python - how to go to the next assistant page
Daniele Visaggio
visaggio.daniele at gmail.com
Wed Jan 6 06:55:43 EST 2010
Hi list,
I realized an assistant with Glade 3.6.7. The assistant appears
correctly on the screen but the "Forward" button is not active, so the
wizard is blocked on the first welcome page.
With the help of Google I understood that in order to activate the
button I should use the assistant.set_page_complete() to unblock the
button and then the set_forward_page_func() to move to the next wizard
step. But I'm not able to do this in python (i'm still a python
noob :-( ).
Btw, I tried to link the the signal on_assistant1_apply (i.e. the event
that should happen when the final user hits the forward or the apply
button) to the on_assistant1_apply callback function, which triggers the
set_forward_page_func() method. Obviously, this doesn't work.
Until now I wrote this little script:
################################################
#!/usr/bin/python
#code snippet for a gtkassistant
import gtk, gtk.glade, pygtk
pygtk.require("2.0")
def on_assistant1_destroy(widget, data=None):
gtk.main_quit()
def on_assistant1_cancel(widget, data=None):
assistant1.destroy()
def on_assistant1_apply(widget, data=None):
assistant1.set_forward_page_func(page_func=None, data=None)
gladeFile = gtk.glade.XML("assistant.glade")
assistant1 = gladeFile.get_widget("assistant1")
signals = {
"on_assistant1_destroy" : on_assistant1_destroy,
"on_assistant1_cancel" : on_assistant1_cancel,
"on_assistant1_apply" : on_assistant1_apply
}
gladeFile.signal_autoconnect(signals)
if assistant1:
assistant1.show()
gtk.main()
################################################
How can I fix this?
Thank you in advance,
Daniele Visaggio
More information about the Glade-users
mailing list