set stack rect in startup handler

Martin Baxter mblivecode at harbourhosting.co.uk
Mon Mar 24 11:36:47 EDT 2014


Hi Craig,

In the IDE it works correctly when startup is invoked from msg, but once
the stack is built into a standalone it doesn't.

The standalone in question is just to test this issue, and has only a
quit button. I build it with a size different from 200 by 200, so I can
tell that the on startup handler runs, because the stack is resized to
200 by 200, but is not placed at screen loc 300,300 as expected.

However the line does work as desired if placed into the preopenstack
handler instead of on startup.

I'm not keen to move my configuration code to the app's preopenstack if
I can avoid it though - in the actual application that I'm working on
that could be a bit untidy, the real-world case is more involved than
the test stack of course.

Martin

On 24/03/14 15:15, dunbarx at aol.com wrote:
> Martin.
> 
> 
> What happens if you run this line from msg after the window is open?
> 
> 
> 
> Craig
> 
> 
> 
> -----Original Message-----
> From: Martin Baxter <mblivecode at harbourhosting.co.uk>
> To: How to use LiveCode <use-livecode at lists.runrev.com>
> Sent: Mon, Mar 24, 2014 10:22 am
> Subject: set stack rect in startup handler
> 
> 
> This:
> 
> on startup
>   set the rect of this stack to "100,100,300,300"
> end startup
> 
> Does not seem to work in version 6.6 (at least for me, on Linux)
> 
> Obviously the idea is to set the initial position of an application window.
> 
> What happens is that the window is correctly sized to 200 * 200 px, but
> the specified position on screen is not honoured. The stack window may
> open centered or displaced by whatever other windows are already open.
> Setting the loc doesn't seem to work either.
> 
> This worked for me in 6.5.2 and earlier.
> 
> I'm thinking this is a bug, does anyone else have any insight on this?
> 
> Martin
> 





More information about the use-livecode mailing list