Location of a modal stack
Graham Samuel
livfoss at mac.com
Fri Dec 16 12:38:41 EST 2011
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?
TIA
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!
More information about the use-livecode
mailing list