Centering an object in a window

Chipp Walters chipp at chipp.com
Tue Aug 12 01:55:01 EDT 2003


Barry,

try..

on centerTheObject pObject --pObject is the name of the object to be
centered
   set the loc of pObject to the loc of this cd
end centerTheObject

this has the advantage of not using a global variable.

Of course, even easier (as Ken suggests) is to just say:

set the loc of fld "fred" to the loc of this cd

done in only one statement...in this case I probably would not create a
handler for it, just put it inline with the code calling this.

-Chipp

> -----Original Message-----
> From: use-revolution-admin at lists.runrev.com
> [mailto:use-revolution-admin at lists.runrev.com]On Behalf Of Barry Levine
> Sent: Monday, August 11, 2003 8:42 PM
> To: use-revolution at lists.runrev.com
> Subject: Centering an object in a window
>
>
> I'm not sure if this is the proper method but it worked so I thought
> I'd post it.
>
> on centerTheObject
>    global theObject
>    set the loc of theObject to (item 1 of the localloc of the loc of
> this stack) ,\
> 	(item 2 of the localloc of the loc of this stack)
> end centerTheObject
>
> In the script that calls the above, I use:
>
> put myObject into theObject
> -- "myObject" for example being "field m144" (using quotes)
>
> Hope this helps someone.
>
> Regards,
> Barry
>
> _______________________________________________
> 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