setting the loc of a cloned window

Sarah sarahr at genesearch.com.au
Mon May 5 20:25:00 EDT 2003


This is the answer!
My new procedure, which clones a stack and positions it invisibly, is 
as follows:

In the script that does the cloning:
	work out the positioning for the new stack (I use topLeft)
	set a custom property of the ORIGINAL to this position setting
	clone the original

The original (& therefore the clone) has a preOpenStack handler as 
follows:

on preOpenStack
	open invisible me
	set the topleft of me to the cPresetTL of me
	send "drawGraphics" to me in 5 ticks
end preOpenStack

I wouldn't have thought that an open invisible command would have 
worked within a preOpenStack handler as it is already opening, but it 
really does. Strangely, you don't even need to make the stack visible - 
it just appears in the correct place.

One wrinkle (& the reason why the drawGraphics handler is not called 
immediately) - as I mentioned before, cloning a stack overrides the 
lock screen command, so at first, my graphics were drawing visibly and 
slowly. I tried putting another lock screen command at the start of my 
drawGraphics handler but it still didn't work until I used a send to 
call drawGraphics after a delay. Now it all works perfectly :-)

Thanks to everyone who contributed to this solution and especially Ron.

Cheers,
Sarah
sarahr at genesearch.com.au
http://www.troz.net/Rev/


On Friday, May 2, 2003, at 05:26  pm, Ron wrote:

> Hi Sarah
>
> I use an expanded version of the following for several sub-stacks in 
> an app
> and don't see the wd before it opens. This particular ex. tiles the wd.
> Maybe you can try:
>
> on preopenstack
>   global newnotecnt
>   open inv me
>   put the screenloc into themid
>   put the last char of newnotecnt into thenum
>   put (thenum * 20) -100 into themod
>   put themod + item 1 of themid &","& themod + item 2 of themid into 
> newloc
>   set the location of me to newloc
> end preopenstack
>
> Ron
>>
>> No, that doesn't fix it. I still see the clone appearing in a 
>> different
>> place and then moving. The place it appears varies according to the
>> size of the original window.
>>
>> Sarah
>>
>> On Friday, May 2, 2003, at 03:53  pm, Monte Goulding wrote:
>>
>>>
>>> Set the loc of the original before the clone then you won't get the
>>> move.
>>>
>>> Cheers
>>>
>>> Monte
>>>>
>>>> Related to the problem of setting the loc of modal dialogs, I have a
>>>> problem setting the loc of a cloned stack without it appearing in
>>>> another place first.
>>>>
>>>> I have tried locking the screen and making the original invisible 
>>>> but
>>>> the clone always appears above and to the right of the original 
>>>> before
>>>> moving to where I tell it to go. Does anyone know how to do this
>>>> invisibly?
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
>
>
>





More information about the use-livecode mailing list