Registering categories to Vocabulary

Bob Arning arning at charm.net
Sun Apr 15 18:03:11 UTC 2001


On Sun, 15 Apr 2001 18:30:55 +0200 Karl Ramberg <karl.ramberg at chello.se> wrote:
>Hi, I want to register a method to Morph in the Vocabulary
>category 'miselancelous' but can't figure out how it works. 
>
>The method adds functionality for all morphs to follow
>a path e.g. a polygon morphs vertices. 
>
>It's all a little crude at the moment but will hopefully
> be  a nice enhancement for people who want to do some simple 
>animation etc.

Karl,

There are a fair number of possibilities, but here is a simple scenario:

1. Add a description of your method to Morph class>>additionsToViewerCategories like the snippet below:
...
		(miscellaneous (
			(command doMenuItem: 'do the menu item' menu)
			(command karlsCommand 'whatever Karl wants')
			(command show 'make the object visible')
...

2. Add a corresponding method to Player to do the real work:

'From Squeak3.1alpha [latest update: #''Squeak3.1alpha'' of 5 February 2001 update 3928] on 15 April 2001 at 2:00:17 pm'!

!Player methodsFor: 'Karls commands' stamp: 'RAA 4/15/2001 13:59'!
karlsCommand

	self costume position: self costume bottomRight! !

3. Vocabulary initialize

Your addition is now available in the viewer and will work.

Cheers,
Bob





More information about the Squeak-dev mailing list