Greetings, I'm working through http://www.maartensz.org/computing/squeak/Helps/Environment/Workspaces4.htm and * (EmphasizedMenu selections: #('bold' 'plain' 'italic' 'struckout' 'plain' 'nice menu!') emphases: #(bold plain italic struckOut plain bold)) startUp
*Gives me the "MessageNotUnderstood" error: doesNotUnderstand: aMessage "Handle the fact that there was an attempt to send the given message to the receiver but the receiver does not understand this message (typically sent from the machine when a message is sent to the receiver and no method is defined for that selector)." "Testing: (3 activeProcess)"
(Preferences autoAccessors and: [self tryToDefineVariableAccess: aMessage]) ifTrue: [^ aMessage sentTo: self].
MessageNotUnderstood new message: aMessage; receiver: self; signal. ^ aMessage sentTo: self.
Can someone explain what I've done wrong? (currContext := only)
Thomas,
Did you get responses?
(EmphasizedMenu selections: #('bold' 'plain' 'italic' 'struckout' 'plain' 'nice menu!') emphases: #(bold plain italic struckOut plain bold)) startUp
In Squeak 3.8 or such, if I change it to:
(EmphasizedMenu selections: #('bold' 'plain' 'italic' 'struckout' 'plain' 'nice menu!') emphases: #(bold normal italic struckOut normal bold)) startUp
, 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.
-- Yoshiki
beginners@lists.squeakfoundation.org