Font and Font Size . . .
David Squance
squance at elkvalley.net
Wed Jun 23 20:31:48 EDT 2004
>Can someone please help me: Since my standalone app will have a lot of
>text editing, I want to allow the user to change font and font size. I
>know how to build the menus but I don't know how to script it. Any
>help will be greatly appreciated.
>
>Thanks, Roger
You may have some better replies from more experienced Revers, but this is
what I've done:
I created a list field to hold the font names I wanted available and a
button to show that field. The field has the following script:
on mouseup
put the value of the clickline into cline
set the textfont of fld "data" to cline
put cline into fld "dfont"
hide fld "fontlist"
end mouseup
the field "dfont" shows the currently active font.
Something very similar is set up for the text size. The field with the
choices has this script:
on mouseup
put the value of the clickline into cline
put cline into fld "fontsize"
set the textheight of fld "data" to 12
hide fld "sizelist"
end mouseup
Again, the field "fontsize" shows the current size and the field "sizelist"
is hidden until a button shows it and holds the choices you want available.
HTH
Dave
More information about the use-livecode
mailing list