Auto-size buttons?

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


Mark,

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 sonsothunder.com
Web Site: http://www.sonsothunder.com/

----- Original Message -----
From: "Mark Swindell" <mdswindell at charter.net>
To: <use-revolution at lists.runrev.com>
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 lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the Use-livecode mailing list