stack rect will not set the first time...

Klaus Major klaus at major-k.de
Wed Jul 28 07:45:41 EDT 2004


Hi friends,

strange problem...

I have a palette and want to set its rect horizontal/vertical like the 
"2lz2" palette...

Setting to vertical does ALWAYS work, but setting to horizontal does 
NOT,
i have to click TWICE!!!


Here are the almost identical handlers:

on machvertikal
   lock screen
   put the topleft of stack "2lz3" into obenlinks
   put item 1 of obenlinks into links
   put item 2 of obenlinks into oben
   repeat with i = 1 to the num of controls of cd 1
     set the loc of control i of cd 1 to the vertikal of control i of cd 
1
   end repeat
   set the rect of fld "dasding" of cd 1 to 0,427,64,460
   set the rect of stack "2lz3" to links, oben, (links + 64), (oben + 
516)
### This line ALWAYS works!!! ???
   unlock screen
   set the orientierung of  stack "2lz3" to "vertikal"
   set the altloc of stack "2lz3" to "vertikal" & CR & the rect of stack 
"2lz3"
end machvertikal

This handler ALWAYS works completely and immediately!

###############################################
on machhorizontal
   set the orientierung of  stack "2lz3" to "horizontal"
   put the topleft of stack "2lz3" into obenlinks
   put item 1 of obenlinks into links
   put item 2 of obenlinks into oben
   lock screen
   repeat with i = 1 to the num of controls of cd 1
     set the loc of control i of cd 1 to the horizontal of control i of 
cd 1
   end repeat
   set the rect of fld "dasding" of cd 1 to 15,0,205,32
   set the rect of stack "2lz3" to links, oben, (links + 726), (oben + 
60)
## THIS line does ONLY work when this menu is selected the SECOND 
time...
## I also tried to set height and width separately, but with the same 
result...?

   unlock screen
   set the orientierung of  stack "2lz3" to "vertikal"
   set the altloc of  stack "2lz3" to "vertikal" & CR & the rect of  
stack "2lz3"
end machhorizontal


NO front-/back-scripts are in the way!

Any hints are very welcome...

Engine version: 2.2.1
OS: Mac OS X 10.3.4


Regards

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the use-livecode mailing list