[REBOL] Re: How to change the font of a button ?
From: maximo::meteorstudios::com at: 30-Jun-2003 14:21
I usually create my fonts in advance and switch between the different versions dynamically,
in order to reduce the amount of ram being used by each face.
try this:
gui: layout [
abutton: button "rebol est cool" 150x30 [face/font: either ((face/font) = font-a) [:font-b][:font-a]
show face]
]
font-a: make abutton/font [
size: 12
]
font-b: make font-a [
size: 18
]
abutton/font: font-a
view gui
by clicking on the button, you should toggle between each font each time you press on
the button...
The reason I built the layout before the font is that the vid button style adds the /colors
attribute to the font object... by makin a font from the allocated button, the fonts
created are sure to have any other custom attributes added by the style.
-maxim