[Newbies] Morph import corrupted

Mark Carter mcturra2000 at yahoo.co.uk
Sun Jan 18 16:34:15 UTC 2009

I'm new to smalltalk and squeak - and I must say, it seems capable of doing some pretty amazing stuff.

I started playing with morphs today. I created a Stack (which I called BlogStack), which has a TextBody (actually a scrolling text morph) and a button. 

The button activates the following script when I mouseUp on the button:

    | |
    TextBody setCharacters: 'Enter text here' .
    ^ self

OK,  printBody is a bad name, but let's not worry about that. The basic idea is that you press the button, and it replaces the TextBody text with  'Enter text here'. So far, everything works as I expect.

Now, I saved my stack morph from one image, and I wanted to see if I could load it in another. It loaded OK, but when I pressed my button, it complained:

'From Squeak3.9 of 7 November 2006 [latest update: #7067] on 18 January 2009 at 4:19:06 pm'! 
!Object methodsFor: 'error handling' stamp: 'md 2/22/2006 21:21'!
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)" 
    MessageNotUnderstood new 
        message: aMessage;
        receiver: self;
    ^ aMessage sentTo: self.
! ! 

I am using Squeak 3.9 update #7067 for both the imported and exported morph.

Curiously, if I open up the viewer on TextBody, I can toggle through most of its categories (basic, scripts, and so on), but it throws an exception if I try to go to 'colour & border' or 'text'. What's going on? Is it a bug?

Should I expect morphs to work across images? What about if I upgrade squeak - what's the chance that I'll still be able to load my morphs?

Also, is there any way that I can create a class, or gain access to, BlogStack, say by doing something like:
b := BlogStack .
Would you advocate actually creating GUIs programmatically? It seems a safer bet, although rather more tedious.


More information about the Beginners mailing list