Newbie question

Glen L. Bledsoe glenbledsoe at mac.com
Mon Jul 15 20:03:01 EDT 2002


I've figured out (with help from below) how to set the size and style of 
selected text. I've created a menu/button "Fonts" but I can't figure out 
how to set selected text to fonts that are on any given computer. I added

on openStack
   put fontnames() into btn "Fonts"
end openStack

to the stack script. What do I do next?

Thank,
Glen	


On Monday, June 24, 2002, at 07:05  AM, use-revolution-
request at lists.runrev.com wrote:

>
> Also, there will be a number of scripts to handle Text menus in the
> upcoming Cookbook (next version). Here's one:
>
> on menuPick theMenuItem -- goes in the menu button
>   set the itemDelimiter to "|"
>   switch item 1 of theMenuItem -- the submenu name
>   case "Font"
>     set the textFont of field "Example Text" to item 2 of theMenuItem
>     break
>   case "Size"
>     set the textSize of field "Example Text" to item 2 of theMenuItem
>     break
>   case "Color"
>     set the textColor of field "Example Text" to item 2 of theMenuItem
>     break
>   case "Plain"
>     -- plain removes all styles
>     set the textStyle of field "Example Text" to empty
>   default -- for Bold, Italic, Underline
>     put the textStyle of field "Example Text" into currentStyle
>     set the itemDelimiter to comma
>     if theMenuItem is among the items of currentStyle then
>       -- already has that style, so remove it
>       delete item (itemOffset(theMenuItem,currentStyle)) \
>          of currentStyle
>     else
>       -- add the style to any existing styles
>       put comma & theMenuItem after currentStyle
>     end if
>     set the textStyle of field "Example Text" to currentStyle
>   end switch
> end menuPick




More information about the Use-livecode mailing list