Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Text width in VID (Was: Re: Compressing image data (bugs?))

From: atruter:labyrinth:au at: 6-Dec-2003 20:44

> Still, are there easier ways?
I don't know about easier, but I use code like the following: get-text-size: function [fontsize [integer!]][t][ layout [t: text font-size fontsize "MMMMMMMM"] size-text t ] to determine the size of a base "element" and then stylize/master all my widgets (in addition to changing origin / space) like: stylize/master [ btn: btn to-size 1 1 font-size to-integer fontsize * .75 choice: choice to-size 1 1 font-size fontsize div: box red as-pair element/x element/y / 10 field: field to-size 1 1 font-size fontsize ... ] whichs enables me to have a UI that dynamically responds to fontsize changes whilst maintaining the same look. This solution works for me (where I need to have things appear the same relative size across a wide range of display size resolutions), but it is certainly not an ideal one. Regards, Ashley