Il giorno lun, 11/10/2010 alle 21.17 +0200, Mauro Giacomini ha scritto:
> Il 11/10/2010 19:45, Pietro Battiston ha scritto:
> I write a pseudo-code that can hel you and the others to identify my
> problem.
> <pseudo-code>
> class MyAssistant:
> def __init__(self):
> step_one()
> step_two()
> step_finale()
>
> def step_one(self):
> text to welcome the user
> treeview
> button_up
> button_down
> button_apply
> button_apply.connect('clicked', self.on_confirm_sort_treeview)
>
> def on_confirm_sort_treeview(self, button, data = None):
> I mark page_one of assistant as complete
>
> def step_two(self):
> here I wanto to collect the data from treeview in the order the
> user set them,
> so I can operate on them
> (1)
>
> def step_finale(self):
> confirm all the user parameters
> </pseudo-code>
> (1) In this point I can't be able to collect the information of the
> treeview, so I can't operate on them.
If I understand correctly, your problem is that you think that "step_n"
runs during the time that the user sees the nth page of the assistant.
That's not the way in which the Assistant generally works: you just fill
pages in advance, and then you let the user move along them.
If you have to call "set_page_complete" based on the content/status of
some treeview, probably (depending on what you really need) the best
thing is to just connect to the "changed" signal of the TreeSelection,
and in the callback for that signal check if everything is fine and in
case call "set_page_complete( that_page, True )". You can connect also
to the "changed" signal of more than one widget.
Alternatively, you can monitor the Assistant with some callback called
by glib.timeout_add(), but I think that's generally more difficult to
manage smartly.
> If I put a "print" in every step_*() functions to simply debug my app,
> on screen I see all the text printed at the beginning of the app.
Yes, that's normal: you first prepare all the pages, then run the
Assistant; its methods do not block the flow of code.
> Hope I described good what I want.
>
> Maybe I can't fully understood the Assistant Widget and I'm using it bad.
> I mean that until a page in an Assistant isn't marked as "completed",
> the user-iteration is in a "waiting-mode"
>
> I googled to search how to use an Assistant, but the tutorials I found
> are few and not fully explained.
I hope I've clarified a bit. I guess you already seen
http://www.learnpygtk.org/pygtktutorial/assistant.html ?
bye
Pietro
>
> Thanks, Mauro
>
>
>
> > Il giorno lun, 11/10/2010 alle 19.09 +0200, Mauro Giacomini ha scritto:
> >
> >> Hi,
> >> I have a problem with the creation of an Assistant.
> >>
> > Ehm... which problem?
> >
> > Pietro
> >
> >
> >> I want to collect information from the user.
> >> In the first page I have a treeview with 3 button (move_up, move_down
> >> and apply).
> >> Until the user don't click on Apply Button, the navigation on the
> >> Assistant is unsensitive.
> >> When the user finished to sort the treeview with the up and down button
> >> and click Apply button, the Next button on Assistant became sensitive
> >> and the user can click it to procede to the second page.
> >> In the second page I want to collect the data from the treeview to make
> >> further processing.
> >> If I have to post some code, tell me, and I will try to post code that
> >> can be executed.
> >> But keep in mind this Assistant is a piece of a bigger project I'm
> >> working on.
> >>
> >> Thanks in advance, Mauro
> >> PS: Sorry for my English, I'm an Italian guy.
> >> _______________________________________________
> >> pygtk mailing list [email protected]
> >> http://www.daa.com.au/mailman/listinfo/pygtk
> >> Read the PyGTK FAQ: http://faq.pygtk.org/
> >>
> >
> >
> >
>
> _______________________________________________
> pygtk mailing list [email protected]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/