[IronPython] WPF / ipy minimize weirdness?

Michael Foord fuzzyman at voidspace.org.uk
Tue Apr 6 16:13:19 CEST 2010

Hi Ken,

Weird behaviour of a "main window" when a modal dialog is displayed is 
pretty normal I think. Just a drawback of modal dialogs.


On 06/04/2010 15:10, Ken MacDonald wrote:
> Hi Jimmy,
> Thanks for the note!
> I was thinking more about this last night - the app is a legacy thing 
> I've taken over, where the modal selection dialog is quite a 
> heavy-weight entity - it captures about the same amount of real estate 
> as the underlying application itself, with a dozen or more controls on 
> it, and the user may be fooling around with it for 4 or 5 minutes at a 
> stretch. We've concluded that it should really just present as a 
> separate page on the app, rather than as a modal dialog, and probably 
> next release we'll be moving toward that; it solves a stack of other 
> interesting problems as well.
> For the time being, we are trying to get to a point where someone may 
> have not finished messing with the selection dialog, and wants to just 
> minimize the whole thing (selection and main app window) in order to 
> move to another app. The 'other app' may be another copy of this one, 
> just running on a different data store, thus the need to get rid of 
> (minimize completely) the 1st copy to avoid confusion! Obviously, when 
> we move to a single window design this problem goes away; right now 
> just trying to get the two windows in the app (if the selection dialog 
> is active) to act "in unison".
> In answer to your question, without any event handlers in place, I can 
> minimize the selection dialog using the standard Windows "_" control, 
> which leaves the main app window in view, but totally disabled - 
> minimize, exit, etc. are disabled along with any of the app's 
> controls. Taskbar still had two icons, one for the dialog and one for 
> the main app, and I could restore the dialog and continue.
> When I added in an event handler, both the selection and main app 
> windows disappeared, with the modal dialog apparently completely gone 
> (no taskbar icon any more) and the underlying app still waiting for 
> it, so it's taksbar icon was completely disabled, unable to restore, 
> cancel, anything.
> Hope to get this to work in some fashion, but as I said, I'm going to 
> be turning this into a separate page for a single app at some point so 
> I may find some interim not-quite-what-they-want solution if this 
> turns out to be too much effort to get going.
> Ken
> On Tue, Apr 6, 2010 at 3:56 AM, Jimmy Schementi 
> <Jimmy.Schementi at microsoft.com <mailto:Jimmy.Schementi at microsoft.com>> 
> wrote:
>     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-bounces at lists.ironpython.com
>     <mailto:users-bounces at lists.ironpython.com>
>     [mailto:users-bounces at lists.ironpython.com
>     <mailto:users-bounces at 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 at lists.ironpython.com <mailto:Users at lists.ironpython.com>
>     http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100406/2d9230aa/attachment.html>

More information about the Ironpython-users mailing list