[Newbie] - Building a Morphic UI - more

Elod Kironsky kironsky at grisoft.cz
Thu Mar 2 15:24:27 UTC 2006


Hi Dugald!

> Before I get onto the "big one"... Although radio buttons are 
> ThreePhaseButtonMorphs, how do you group them so that switching one on 
> turns the others off, unless you manage it by hand (again)?  I have 2 
> different radio button groups.  Sounds like there is scope for a 
> standard widget - a RadioButtonGroup.  As it is, radio buttons have 
> extremely weird behaviour as one has to drag the cursor off them to 
> turn them off.
>
What is the problem with a RadioButtonGroup? Other system also manage it 
in a similar way, the only difference is, you do not have to generate a 
different class, but something must be in the background and manage 
those buttons.

> The BIG ONE... Below the SystemWindow what Morph hierarchy do I 
> construct in order to be able to draw my model in a View (or is it 
> Form) that I can pan around with horizontal and vertical scroll bars 
> and scale.  I also need to be able to pick objects on screen and move 
> them around as well as to be able to locate points in the model 
> space.  I need some form of mouse controller.  I can't see where mouse 
> down/up/move events get managed.  I have resorted to looking at the 
> Purple Book as well as Mark Guzdial's, but neither show an example 
> similar to what I would expect or want.  Where does the Form come in? 
> Is this the GraphicsContext in VW?
>
You will be surprised how easy this is. Just define in your class/form a 
method handlesMouseDown: evt and return true. Then define the method 
mouseDown: evt, what is actually the event handler of your morph. Try to 
find those methods in method finder and have a look at other classes.

> Currently I have a subclass of StandardSystemView which accesses my 
> model.  This needs to be displayed on a Form, I presume.  But I think, 
> and possibly misunderstand, that I am to be creating an ImageMorph on 
> a Form in the SystemWindow, but this should dynamically change as I 
> move bits of my model around by cursor events.  When does the 
> displayOn: message get sent?
>
> To help in my BIG ISSUE, a component hierarchy diagram might be useful 
> to show the nesting of UI components in the SystemWindow.  And how the 
> mouse/cursor interaction is managed would be useful too.
>
I strongly advice you to have a look at the Jacaranda package. It is an 
UML like diagram editor. When I started to work with morphs it was my 
starting point.

>
> Following from one contributer's suggestion that I can modify anything 
> in Squeak I wish.  I do not think the basic Squeak UI widget set has 
> sufficient functionality nor consistency with other UI systems for one 
> to be able to use them without serious modification.  And I would 
> rather spend my time doing the _useful_ bits of engineering rather 
> than wasting a disproportionate amount of time scrabbling around at 
> the bottom of the system in order to create a usable UI.  BTW - The 
> ProgrammingMorphs package does not load into Squeak 3.8.
>
I think one of the greatest advantages of Morphic is the great number of 
widgets supplied with it. You must realize, that this system is/was not 
intended to provide a repository of widgets for professional or industry 
use. The main goal of that widgets is to teach by example and to provide 
a base that you can use to build your own classes. ProgrammingMorphs 
package does load into Squeak 3.8. You probably upgraded the SquakMap 
Loader and older packages do not work with the newer version. Try to 
download the package manually from SqueakMap and load into Squeak.

> Over the last few years, I have had to work building UIs in different 
> systems, and I am developing an extreme aversion to them!  Whichever 
> system you use, it takes far too many steps to get information from 
> the user into the _real_ program that does the work.
>
In this case I can only advice you to stop with UIs :-) BTW: did you try 
wxSqueak?

Elod



More information about the Squeak-dev mailing list