[Newbies] EmphasizedMenu question
yoshiki at squeakland.org
Thu Jun 29 03:14:18 UTC 2006
Did you get responses?
> selections: #('bold' 'plain' 'italic' 'struckout' 'plain' 'nice menu!')
> emphases: #(bold plain italic struckOut plain bold))
In Squeak 3.8 or such, if I change it to:
selections: #('bold' 'plain' 'italic' 'struckout' 'plain' 'nice menu!')
emphases: #(bold normal italic struckOut normal bold))
, it works.
> Gives me the "MessageNotUnderstood" error:
For a doesNotUnderstand: error, it is usually helpful to look at the
context "one below"; the context that is sending the unknown selector
to an object. In this case, it is a bit tricky because the selector
not understood is sent via #perform:, but if you look at the
currEmphasis variable in the debugger, you'll see that #plain is what
the object doesn't understand.
This gives you a clue. The object understands #bold, but not
#plain. In this case, you select the string "bold", and press
Alt-m. It shows the implementors of #bold and there is onle one of
them. (TextEmphasis class). If you browse full the TextEmphasis
class, you can guess that you should use #normal instead of #plain.
More information about the Beginners