I posted a request yesterday and was able to partially solve the problem.
Let me explain what the problem is.
A main GUI (GUI #1) is displayed with a single button. When the user
pushes the button, another GUI (GUI #2) appears with a Save button on it. When the user
presses the Save button, a dialog box appears and prompts the user to select a file to be saved.
When the user presses Save on the dialog box, the dialog box disappears of the screen as it should. Is
there a way that GUI #2 disappears as well?
I include below an example. Notice that I partially solve the problem by adding "info.ui.dispose()"
in the handler. Unfortunately, this is not satisfactory for me. The problem is that once GUI #2 is gone,
there is no trace of its attributes. To see that, I include in the example two print statements:
(1) print 'a', filename #(inside GUI #2)
(2) print 'b', filename #(inside GUI #1, after disposing of GUI #2)
Have a look at the example:
from enthought.traits.api import HasTraits, Button, Str
from enthought.pyface.api import FileDialog, OK
from enthought.traits.ui.api import View, Item, Handler
from enthought.traits.ui.menu import Action
def save(self, info):
""" Save location info to location file and load the location info """