making the for loop wait for the frame to return

Hi all

I have code snippet here which iterates over the command line arguments.

I want the for loop to wait for the user to close the frame before it process the next argument.

any idea how I should do this

for i in range(1,len(sys.argv)):
if (os.path.isfile(sys.argv[i])):
print “me going forward”
saveResult=SaveFileToDefaultLocation(sys.argv[i])
if (not saveResult):
self.main=self.processSaveLocationSelect(sys.argv[i])
self.SetTopWindow(self.main)
self.main.Show();self.main.Hide();self.main.Show()

cheers

Thomas

Thomas Thomas wrote:

Hi all
I have code snippet here which iterates over the command line arguments.
I want the for loop to wait for the user to close the frame before it process the next argument.
any idea how I should do this
for i in range(1,len(sys.argv)):
       if (os.path.isfile(sys.argv[i])):
       print "me going forward"
       saveResult=SaveFileToDefaultLocation(sys.argv[i])
       if (not saveResult):
              self.main=self.processSaveLocationSelect(sys.argv[i])
              self.SetTopWindow(self.main)
              self.main.Show();self.main.Hide();self.main.Show()

Rather than processing your items in a single loop like this you need to convert it to an event driven approach. For example, do the first item, then in the frame's EVT_CLOSE handler do something that will cause the next item to be processed, etc.

BTW, it should not be necessary to do the Show/Hide/Show trick any more.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!