Auto-size buttons?

Ken Ray kray at
Sat Dec 28 02:38:01 EST 2002


I'm doing this in OS X right now with option buttons. Here's my code:

on menuPick pChoice
  put the formattedWidth of me +15 into tW  -- 15 is my right "margin"
  put the rect of me into tRect
  put (item 1 of tRect) + tW into item 3 of tRect
  set the rect of me to tRect
end menuPick

This resizes buttons to the right (i.e. the menu is left-aligned). To make
it right-aligned (and resize to the left), simply change the third-to-last
line of the code to:

  put (item 3 of tRect) - tW into item 1 of tRect

Have fun!

Ken Ray
Sons of Thunder Software
Email: kray at
Web Site:

----- Original Message -----
From: "Mark Swindell" <mdswindell at>
To: <use-revolution at>
Sent: Saturday, December 28, 2002 12:11 AM
Subject: Auto-size buttons?

> Is there a way to auto-size buttons so that they grow/shrink to fit their
> labels with a developer-defined margin?
> Thanks
> Mark
> _______________________________________________
> use-revolution mailing list
> use-revolution at

More information about the Use-livecode mailing list