[IronPython] WPF / ipy minimize weirdness?

Ken MacDonald drken567 at gmail.com
Mon Apr 5 21:25:54 CEST 2010

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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100405/312e1f2e/attachment.html>

More information about the Ironpython-users mailing list