[squeak-dev] widget sets/GUI builders

Hannes Hirzel hannes.hirzel at gmail.com
Sat Apr 17 17:36:59 UTC 2010


Ross,

Maybe
     FillInTheBlankMorph
gives some ideas



FillInTheBlankMorph
		request: 'What is your favorite color?'
		initialAnswer: 'red, no blue. Ahhh!'


Just creating an 'accept' button is quite an exercise though


createAcceptButton
	"create the [accept] button"
	| result frame |
	result := SimpleButtonMorph new target: self;
				 color: ColorTheme current okColor.
	result
		borderColor: (Preferences menuAppearance3d
				ifTrue: [#raised]
				ifFalse: [result color twiceDarker]).
	result label: 'Accept(s)' translated;
		 actionSelector: #accept.
	result setNameTo: 'accept'.
	frame := LayoutFrame new.
	frame rightFraction: 0.5;
		 rightOffset: -10;
		 bottomFraction: 1.0;
		 bottomOffset: -2.
	result layoutFrame: frame.
	self addMorph: result.
	self
		updateColor: result
		color: result color
		intensity: 2.
	^ result

Hannes

On 4/17/10, Ross Boylan <ross at biostat.ucsf.edu> wrote:
> Which, if any of the GUI builders (e.g.,
> http://wiki.squeak.org/squeak/1576) work in 3.10.2 and are likely to
> work in 4.x?
>
> Even though I've built squeak GUIs before, I'm finding that making a
> basic data entry form is quite a project.  Among the problems:
>
> * no standard one line text entry widget (PluggableTextMorph can be
> adopted, but needs lots of tweaks and doesn't include a label)
> * no grouping boxes for sets of related widgets (I suppose a
> RectangleMorph would server)
> * layout not obvious, and not well documented.  There was a nice
> tutorial on the the SuperSwiki, but that's gone and the the layout logic
> may have moved on a bit.
>
> For example, I tried
> | w m |
> w := SystemWindow labelled: 'Test'.
> w layoutPolicy: TableLayout new.
> m := PluggableTextMorph on: w text: #label accept: #label:.
> w addMorph: m.
> w openInHand.
>
> The window border decorations appear individually below the text field,
> rather than around the edge of the window.  I've since noticed that
> SystemWindow has a ProportionalLayout by default.
>
> I suppose I should put some morph  (what?) insider the SystemWindow and
> do the layout in the inner morph.
>
> It's not clear if some of the layout related methods (e.g., about
> frames) are only for TableLayout or only for ProportionalLayout.
>
> Ross
>
>
>



More information about the Squeak-dev mailing list