Window Positioning

Terry Judd tsj at unimelb.edu.au
Tue Dec 7 20:22:10 EST 2010


Custom properties are good for this sort of thing. Create a stack property
named cTL and populate it with the (topLeft) coordinates that you want the
stack to initially open with. Then in you preopenstack handler...

on preopenstack
    set the topleft of me to the cTL of me
end preopenstack

Then if you want to recall the last known position of the stack the next
time you open it then just modify the cTL property each time you close the
stack

on closestack
    set the cTL of me to the topleft of me
end closestack

Alternatively you can just hide stacks rather than closing them by trapping
the closeStackRequest message, and then show them the next time you open
them. That way there is no need to capture and reset their location.

on closestackrequest
    set the visible of me to false
end closestackrequest

You can query the openstacks to see whether the stack needs to be opened
(first time) or simply shown (subsequent times).

HTH,

Terry...

On 8/12/10 12:06 PM, "Peter Haworth" <pete at mollysrevenge.com> wrote:

> OK, I understand.  It sounds like I should be specific about the
> default position where I want each of my windows to appear and then
> come up with a scheme for the standalone that saves the position of
> each window when it's closed.  I already have a scheme in place to
> save other settings in an outboard file because of not being able to
> save stuff within the standalone so that shouldn't be a big deal.
> 
> A lot of this has to do with windows getting hidden behind other
> windows.  I already have a menu that lists all the currently open
> windows so users can easily get to one that is hidden by selecting it
> from the menu but I think attempting to avoid that problem by specific
> positioning would be a good idea.
> 
> Pete Haworth
> 
> On Dec 7, 2010, at 4:18 PM, Björnke von Gierke wrote:
> 
>> stacks save their position and size into themselves when you save
>> them, be it via the save menu or by any other means. Stacks that are
>> a standalone can't save themselves. Other programs use  setting
>> files or the registry to save their window size and positioning
>> between launches.
>> 
>> Note that the IDE might reposition your stacks, depending on the
>> windowboundingrect which excludes the IDE's menubar, iconbar and the
>> tools palette from the available places for stacks.
>> 
>> 
>> On 7 Dec 2010, at 23:59, Peter Haworth wrote:
>> 
>>> Given that I  don't provide any coordinates for the window position
>>> when I open a stack, what default position does LC use?
>>> 
>>> My stack windows always seem to open at the same coordinates but
>>> each stack window is at a different location.  If I drag a stack
>>> window to a different location on the screen, close it, then open
>>> it again, it is displayed at its original position, not the one I
>>> dragged it to so it seems like it's my responsibility to record the
>>> window location in those circumstances if I want it to open at the
>>> same location next time around.
>>> 
>>> Pete Haworth
>> 
>> 
>> -- 
>> 
>> official ChatRev page:
>> http://bjoernke.com?target=chatrev
>> 
>> Chat with other RunRev developers:
>> go stack URL "http://bjoernke.com/chatrev/chatrev1.3b3.rev"
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

--
Dr Terry Judd | Senior Lecturer in Medical Education
Medical Education Unit
Melbourne Medical School
The University of Melbourne






More information about the Use-livecode mailing list