A problem with Font Menu in LC Resource Center

Peter M. Brigham, MD pmbrig at gmail.com
Sat Apr 7 15:35:41 EDT 2012


On Apr 7, 2012, at 1:38 PM, Charles Szasz wrote:

> Peter,
> 
> Thanks! But that is how the script is presented in the Resource Center with no breaks before the end of the switch. I did insert a break after the last case statement but the script still does not work. Any other suggestions?

Just a guess, but you might need to avoid changing the itemdelim within the switch-case structure, maybe try something like:

on menuPick theMenuItem
  set the itemDelimiter to "|"
  put item 1 of theMenuItem into itemChosen
  put item 2 of theMenuItem into subItemChosen
  set the itemDelimiter to comma
  switch itemChosen ---the submenu name
     case "Font"
        set the textFont of field "Example Text"\
               to subItemChosen
        break
     case "Size"
  -- <snip>
  -- ... then later
  
     case "Bold"  ---These two remaining menu items
     case" Italic"  ---are handled with the same piece of code!
        put the textStyle of field "example text" into currentStyle
        -- set the itemDelimiter to comma ---*** take this out
        if theMenuItem is among the items of currentStyle then
  -- <snip>

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig





More information about the use-livecode mailing list