Location of a modal stack

Phil Davis revdev at pdslabs.net
Fri Dec 16 13:26:35 EST 2011

Hi Graham,

This isn't an answer to your question, but try setting the loc of the modal 
stack in a 'preOpenStack' handler in the modal stack's card 1 script. That 
works. You could probably 'conditionalize' it by saying

on preOpenStack
    if the mode of this stack = 5
    then set the loc of this stack to the screenLoc
end preOpenStack


On 12/16/11 9:38 AM, Graham Samuel wrote:
> It seems that the calling stack has to be open to influence the location of a modal stack, so my scheme of setting the location of my library stack before invoking a dialog box didn't seem to work - normally there is no reason to open a library stack if it's just a repository for a script put into the message path by a 'start using' command. After I added
>   open invisible stack "MyLibraryStack"
> before
>   set the loc of stack "MyLibraryStack" to the screenLoc
> before calling up any dialog boxes, then it appeared to work OK, almost… for some reason the first 'answer file' to be uninfluenced by anything I do (at least in my environment, which is Windows XP Home running on Parallels 7 on a Mac).
> Can anyone confirm/explain this, or have I got into even more obscure corners of LC?
> Graham
> I wrote:
>> Ken, it always amazes me how much you know! I have already incorporated a slightly earlier version of your solution (only difference was it didn't use a custom property) and it worked fine: the news to me was that
>>> modal stacks are by default set to be centered over the stack that calls it
>> My problem was that I have a library stack that handles all my input and output, so the 'answer file' etc dialogs, and my home-grown ones too, come from there - I never think of this stack has having a location at all, since it's just a depository for scripts - at present its location is just the one it was given by the IDE when it was created. So for me the trick is probably to make sure that the loc of this library stack (which the user never sees) is the same as the loc of the main window which my user does see (this is an app that fills the screen on the basis of 'the working screenrect').
>> If as I am fairly sure is true, the documentation doesn't mention this issue, I will suggest a note in the docs or the dictionary, if I can think of a good place to put it!
> _______________________________________________
> 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

Phil Davis

PDS Labs
Professional Software Development

More information about the Use-livecode mailing list