I have a working example of Count UI in morphic. Morphic-UI.st (You'll first need the Counts.st class from Downloads) It should show up as UI in the morphic world. Try the CountValueViewMorph.I wasn't able to create the same API for the UI package in morphic. I couldn't find a way to add morphs at particular coordinates within a view. Everything in Morphic seems to be added in rows and columns using a layout manager. A layout manager can be vertical or horizontal. Its possible to add an object per row/column. The object itself could be another layout manager ... so its very flexible.
The UI has a ModelValueViewMorph which generates buttons and text views as expected. The difference is in the layout of the view. The class has a vertical layout manager.
The buildViewOn: for each subclass will need a separate method to add each row in the view. In case of Count, it has three statements. - add the three buttons, a horizontal layout manager - dummy morph as spacer - add the display box
The main layout manager in this case has three objects.
Each subclass of ModelValueViewMorph will need to have: - separate methods to generate each row of the main view - buildViewOn: to add all the rows - initialize, this would create the model and call the appropriate method to open the view. This is required since its not possible to run morphs from the workspace.
I think programming in Morphic world would be easier once the code gets documented. Since it doesn't require the MVC approach, it should be possible to collapse everything into a single class. I don't know whether this is good or bad as the students would already be familiar with the non-MVC approach since cs1502 has gone 100% Java.
Janak
-- Janak R. Bhalodia janak@cc.gatech.edu
"More About Squeak..."
Last modified at 1/30/98; 9:42:14 AM
Home Page for How To Squeak
Other Links of Interest
College of Computing | EduTech Institute | GVU Center
Mark Guzdial | CS2390, Modeling and Design | STABLE