Interplay of modal dialogs
Interplay of modal dialogs
- Subject: Interplay of modal dialogs
- From: "Bob Swerdlow" <email@hidden>
- Date: Tue, 15 Jul 2003 14:19:47 -0400
I have a situation where my application shows a modal panel and one of the
buttons opens another modal panel. That panel can do some stuff or allow
the user to return to the first panel. I know that there can only be one
modal panel at a time, so when I show the next panel, I stop the first one.
However, when the user chooses to go back to the first panel and my code
stops the second one and redisplays the first one, the display is wrong -
only those parts of the window that were obscured are redrawn, and if I
force a redraw then the button that was last pushed is still highlighted.
Clearly, I need to do something more to get the dialog to return to its
original state.
Here's some code snippets (I'm using PyObjC):
The first dialog is displayed with:
application.runModalForWindow_(self.FirstPanel)
If the user clicks on the button in that dialog, the target member does:
application.abortModal()
self.panel.close()
application.runModalForWindow_(self.NewPanel)
If in the new panel, the user clicks on the button to go back to the first
panel, the target member does:
application.abortModal()
self.panel.close()
application.runModalForWindow_(self.FirstPanel)
I started adding calls to display() and makeKeyAndOrderFront_() and so on to
try to get the panels to present properly, but it seems to be this is bound
to be problematic. The real question is how do I get the code to "let go"
of the panel so that it can redisplay itself properly? It seems that
abortModal() and close() are not enough.
Thanks for your help!
Bob Swerdlow
COO
Transpose
email@hidden
207-781-8284
http://www.transpose.com
----------------------------------
Fight Spam!
Add this link to your signature (as I did):
http://wecanstopspam.org
Click through to find out more.
----------------------------------
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.