"Louis Sumberg" <
[hidden email]> wrote in message
news:b248fb$18luqg$
[hidden email]...
> UserLibrary>>isIconic: seems to be more reliable than
ShellView>>isMinimized
> in determining if a window is minimized or not, as evidenced by the
> following workspace code:
>
> sv1 := ShellView show.
> eventBlock1 := [:aPositionEvent | aPositionEvent isResize ifTrue:
> [aPositionEvent window isMinimized ifTrue: [Sound bell]]].
> sv1 when: #positionChanged: send: #value: to: eventBlock1.
> "Maximize shellview, then toggle between max and min and the bell will
ring
> every time."
The internal flag is set in response to the WM_SIZE event, which itself is
sent by the default window procedure as part of its processing of
WM_WINDOWPOSCHANGED, i.e. if you test it in a handler for #positionChanged:,
then it will not yet have been updated.
You can detect minimisation and restoration events by hooking #viewMinimized
and #viewRestored events. There is no #viewMaximized event (I'm not sure
why).
There is a "todo" in place to have the internal flag updated in the
WM_WINDOWPOSCHANGED to avoid the need for a WM_SIZE handler, but the latter
has flags which make it easier to determine what type of resize event has
taken place and these do not appear to accompany the former.
Regards
Blair