widget sets/GUI builders

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

widget sets/GUI builders

Ross Boylan
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


Reply | Threaded
Open this post in threaded view
|

Re: widget sets/GUI builders

Hannes Hirzel
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 <[hidden email]> 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
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: widget sets/GUI builders

Javier Diaz-Reinoso
In reply to this post by Ross Boylan
On 17/04/2010, at 12:00, Ross Boylan 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?
I was not aware of this page, I create the BobsUI repository in squeaksource (BobsUI was created by Bob Arning many years ago) and I have committed some updates in the past, but I am not working with BobsUI for the last one and half year (after I lost the last client who dont' care I was using Smalltalk in their applications).

Anyway, I tried to load the code in the trunk and was easy, the only real problem was the in the trunk TextMorph use the SmalltalkEditor by default and BobsUI needs the old SmalltalkEditor, I tested the examples and a little application of mine an looks is working OK. I updated the repository with this changes (I see this Dr.GeoII-HilaireFernandez.76.mcz filename in the BobsUI runtime repository, I suppose is some kind of mistake).

By the way in the page 1576 says:
> It does not include a "GUI builder"... you must specify the widget layout in the source code.
this is not really true, sure dont' have some "Interface Builder" thing, but you create the windows (or frames) using drag&drop from the bobs ui menu (apropos the "pin lock" icon is broken in the trunk, an "Error: Not implemented for depth 8" in Form>>collectPixels:).

>
> 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.
>
This is all implemented in BobsUI, some screenshots:

http://gallery.me.com/javier_diaz_r/100008

> 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
>



Reply | Threaded
Open this post in threaded view
|

Re: widget sets/GUI builders

Hannes Hirzel
In reply to this post by Hannes Hirzel
On 4/17/10, Hannes Hirzel <[hidden email]> wrote:
> Ross,
>
> Maybe
>      FillInTheBlankMorph
> gives some ideas
>
>
A better idea is to start using ToolBuilder which is new in 4.1.
Browse for the buildWith: method to see how it is used. However the
examples are pretty comprehensive.

So it might be an idea to go for a simple one which is on the the
'Beginners list'. I was working on it today and with the help of Bert
F. it was a success. It is a three-pane browser for looking at a
dictionary of dictionaries.

http://lists.squeakfoundation.org/pipermail/beginners/2010-April/007019.html

The code there as such is simple and straightforward if you happen to
read it. But to write it you first have to have the right ideas. In
that particular case that you only need to do a model and that one
build method is sufficient. In addition one had to deal with strings
and not with objects in the lists.

In Java you write more code but it is somewhat easier to see what is going on.

Anyhow to follow a given coding pattern is straightforward.
The nice thing with working with the ToolBuilder is that the same
thing works as well in MVC. *

Hannes


*MVC is currently still buggy and a bit slow. And we are waiting for
wxWidgets to be included.....