Dynamic labels for buttons with (oddshaped) icon images?

J. Landman Gay jacque at hyperactivesw.com
Fri Feb 6 01:12:06 EST 2009


Scott Rossi wrote:
> Recently, J. Landman Gay wrote:

>> I suppose it would be possible to write a little script that would
>> calculate the font size, compare it to the button height, and adjust the
>> margins.
> 
> It's possible, but it's not a little script. :-)  I demoed a customizable
> button object at the last RevLive conference in Vegas.  One can set the font
> of the text, the orientation of the text, margins, and include an icon
> (which orients itself as expected, as opposed to the current behavior). But
> this all needs to be handled as a group of objects. Features in the upcoming
> version of Rev will make this type of control much more practical for end
> users.

I was thinking of something much simpler, just as a work-around. 
Something like this:

  put (the height of btn 1 - the textheight of btn 1) div 2 into tMargin
  set the margins of btn 1 to 0,tMargin,0,tMargin

No bells and whistles though, it just mashes the name into the center. 
The math may need some jiggl...um, adjustments.

Yours is much prettier. Everything you do is much prettier.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the Use-livecode mailing list