Can you manually minimize the modal dialog and then minimize the main window at 
all? The definition of a modal window is that you must interact with it first 
before returning to the main application, so I wouldn't think that you could 
minimize both, and then somehow ever get back to the parent window.

Also, you should try reproducing this with C# or VB; this sounds like it has 
nothing to do with IronPython, just an issue with using the API.

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Ken MacDonald
Sent: Monday, April 05, 2010 12:26 PM
To: Discussion of IronPython
Subject: [IronPython] WPF / ipy minimize weirdness?

Hi,
I have a WPF app and I'm trying to mess with WindowState. I have two windows, a 
modal selection dialog, and a main window. If I bring up the selection dialog 
with the main window in background, and minimize the selection dialog, it 
leaves the main window visible but you can't interact with it. So far, normal.

If I make a selection, the select dialog closes leaving the main window, and I 
can minimize the main window using the standard windows controls, and restore 
it from the taskbar. OK so far.

However, I want to get it working like this: if I minimize the selection 
dialog, I'd like to minimize the main window also. So, I added an event 
listener on StateChanged, something like:

def state_changed(...):
    if self._w.WindowState == WindowState.Minimized:
        main_window.WindowState = WindowState.Minimized

This captures the minimize event, both the selection dialog and main window 
minimize, BUT now I can't right-or-left-click on the minimized app to get it to 
restore, and have to kill the app using task manager. Also, it appears that 
instead of having two windows represented on the taskbar, only the main window 
is left - even though I should still have both the select dialog and the main 
window minimized.

Is there some magic state I need to set in the main window to be able to have 
it restore again? Why should it make a difference whether the minimize is done 
by the main window 'min' button, or by setting its WindowState?
Ken
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to