Screen Postion???

Ban Nguyen bann at sunncomm.com
Thu Jul 21 13:48:21 EDT 2005


I am trying to use this code and I give me an error:

     	executing at 10:45:16 AM
Type	Chunk: can't find stack
Object	main
Line	set the loc of stack item i of "partners, aboutUs, location,
contact" to tCurLoc
Hint	stack "main.rev"


-------------------------------------
You could try to set the position of your stacks relative to the  
screenRect value in a preOpenStack handler in your main stack.
For instance:

on preOpenStack
   local tCurLoc
   -----
   put the screenLoc into tCurLoc
   set the loc of this stack to tCurLoc
   repeat with i = 1 to 5
     add x to item 1 of tCurLoc -- horizontal co-ordinate
     add y to item 2 of tCurLoc -- vertical co-ordinate
     set the loc of stack  item i of  "MySubstack1, MySubstack2, etc"  
to tCurLoc
   end repeat
end preOpenStack

Such a handler will present the main stack centred on- screen and the  
others in cascade according to x and y values.
Of course, you can change all that to suit your needs (working for  
instance with the screenRect too).
It's just to get you the idea.

---------------------------------------------------------

> I am creating an application which has one main stack and 5  
> substacks. I
> lock the size and location using property inspector BUT when I view  
> the
> application on different computers with different screen setting  
> those 5
> substacks are displayed in different locations
>
> The problem is I don't know how to set the location for those 5
> substacks so they are displayed in the right position that I set so I
> don't have to worry about other users' computer screen setting.

-
-



More information about the use-livecode mailing list