View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Sp2001 Midterm Review: UI Toolkit Structure

Explain UI toolkits here:

A. (5) If the controller is essentially the "event loop," where is the event loop in Morphic?

Doesn't Morphic(and any other good UI system) use interrupts to determine system events, thereby removing the need for an "event loop" and any polling of devices(ie. the mouse).

Actually, Morphic in 2.8 is still polling. But it doesn't matter – even if the system is interrupt-driven, there's still some place the UI "goes" when waiting for an interrupt, if there's no other processing to do. So, the event loop doesn't go away. But where is it in Morphic? Mark Guzdial

"A. (5) If the controller is essentially the "event loop," where is the event loop in Morphic?"

It's in the Morphic toolkit and whenever a morph needs to handle a specific event, it registers it with the handleXX: message and it will start receiving that event.

"B. (10) In MVC, we have the dependency mechanism (changed:/update:) for handling the update of the view upon changes in the model. Two questions: (I)
Can we use this mechanism in Morphic? (II) If we chose not to use it, is there another mechanism to insure that the views update properly?"

Yes. You can use it since it's not an MVC-specific concept. (i.e. the addDependent method is defined in Object class and all other classes derive from it). You can also use the step message that gets sent by World to every Morph at regular intervals to query the model for data, instead of heaving the model update the view. But that is less efficient.


I don't remember any of these being addressed in class lectures.
a) Where is the even loop in Morphic? The top level container in a Morphic project is a PasteUpMorph and it has a message called doOneCycleNow. It is this method that processes user events, and it does this by asking each of its HandMorphs to process their events. A HandMorph represents a way for the user to provide input: mouse, keyboard, etc. The HandMorph deals with sending the appropriate messages to the appropriate Morphs.


Link to this Page