[Newbie] - Building a Morphic UI - more
Dugald Wilson
dwilson at cad-schroer.co.uk
Thu Mar 2 14:56:25 UTC 2006
Further to my previous newbie submission of a few days ago...
[Previously on this thread... I have an graphical engineering
application in VisualWorks ST that I am trying to port to Squeak for my
self edification and training.]
I have managed to build the basic UI except for the important bit - the
graphics. I have a few buttons with callbacks, a slider and some radio
buttons. It has been slow and extremely frustrating, going step by
step, feeling my way in the darkness of a lack of documentation. Using
LayouPolicies and LayoutFrames I have managed to create a UI that looks
OK-ish, and stretches and scales itself how I want. There are still
look and feel issues I don't like, such as the title bar and its
constant regeneration that causes any changes of mine ot be lost. The
resultant code is very mucky but will be refactored when the time is right.
I have also managed to suppress the haloes for UI components by
modifying something in Morph. Woo-hoo!
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.
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?
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.
<gripe>
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.
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.
Sorry this appears to be a long gripe, but if I can't see reasonable
progress in my short supply of spare time, I'll just give up and go
juggling instead!
</gripe>
--
Dugald
More information about the Squeak-dev
mailing list
|