Hello,

        I just subscribed to the list, so I hope I'm posting my
question in the right forum.

        I would like to know if there is some standard mechanism (or at
least some best practice to resume operations at the right point after a
dialogue response. Obscure question? Here's the scenario I'm facing:

        The program I am writing can edit a single project at a time.
This means that opening a new file implies closing the previous one.
Now what I want to achieve is the following workflow:

1.  User has uncommitted changes to a project he never
    previously saved, so the project doesn't have a file name yet.
2.  User presses "open saved project".
3.  A dialogue "A" pops up and says: "Your current project has
    uncommitted changes, what would you like to do? Abort new project
    operation, discard changes to current project, or save them?".
4.  User select "save" dialogue.
5.  Dialogue A closes.
6.  Dialogue B1 (file chooser configured for save operation) pops up.
7.  User select file name for project to save.
8.  Dialogue B1 closes, project gets saved.
9.  Dialogue B2 (same file chooser but configured for load operation)
    pops up.
10. User select file to open.
11. Dialogue B2 closes, project is loaded.

        So really, in the above example steps 3 to 8 are a sort of
"interruption" in the obvious workflow of opening a saved project, so
when dialogue A and B1 open, the obvious workflow is halted, and it is
resumed when those dialogue get responded.

        My question is: how to implement this mechanism of
halting/resuming the normal flow of operation? So far the way I
implemented it is via a stack on which - any time I open a popup
dialogue - I push the "resume-from-here callback", and any time I
respond I pop the callback from.

        ...yet it seems as mine is a very common scenario for which
there should be an easier method (maybe a specific function of PyGTK!).

        Many thanks in advance for your help,
        /mac
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to