iconifyStack sends me to the Milky Way

Martin Baxter mb.userev at harbourhosting.co.uk
Thu Nov 23 13:54:10 CST 2006


Mark Powell wrote:
> I want to *close* a minimized stack and go to a second stack at a
> controlled location.  Details...
> 
> I have a window with various elements, one of which is a button that
> performs dragDrop tasks.  I want to give users the option to 'collapse'
> this window to show only the dragDrop button (i.e. resulting in a
> smaller drag-and-drop well).  I currently accomplish this by an
> in-window button that closes the stack and goes to a substack that is a
> reduced version of the first.  It works exactly as I want.  
> 
> I would also like to have the minimize button in the titlebar mimic the
> same thing.
> 
> However, when I trap the iconifyStack message and exectute the same
> instruction set, Windows OS overrides my loc settings and puts the
> destination window at a loc of -31775,-31683.  It also does not respect
> the closeStack handler for the originating stack, leaving it open in the
> taskbar.
>   
> Number one, why the inter-galactic coordinates?  Number two, how do I
> close the first stack?  Number three, any better way of accomplishing
> this?
> 
> Mark

Mark,

Sounds to me that you are making a lot of work for yourself.

I don't really understand why you are keen to subvert the normal
behaviour of minimise. The OS is only doing what the user surely expects
- Hiding the window off-screen at very distant co-ordinates and making it
recallable via the taskbar.

Since it is the OS, not Revolution, that reacts to the minimise event,
I'd expect it would be frustrating to try to circumvent it. Your best
bet in that case might be to have no title bar (decorations empty) and
instead construct a fake title bar of your own (using graphics) that
implement the behaviour you prefer. But you'll have to implement your
own window drag, close etc. as needed.

When I want to collapse a window I just programatically change its size
so that the components I want to hide are no longer visible. Generally I
would store the expanded / collapsed sizes in a custom property of the
stack, and have a small button of my own to grow/shrink the window.

In your case you might also need to have your script resize or
reposition some controls in the window, but this is quite easy to
accomplish, especially if there are only one or two of them.

Martin Baxter




More information about the use-livecode mailing list