The Weekly Juan #4: "Smalltalk, Direct Manipulation and End User Programming"

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

Re: The Weekly Juan #4: "Smalltalk, Direct Manipulation and End User Programming"

Jon Hylands
On Tue, 14 Nov 2006 21:09:37 -0600, Aaron Reichow <[hidden email]>
wrote:

> Along these lines, I shall be sharing some screencasts soon of  
> building simple Morphic apps. I did a simple tutorial over VNC with  
> bmp on #squeak the other evening and it went really well.

I have done a bunch of GUIs in Morphic, and I find it quite nice. Like
Aaron, I build them completely programmatically.

Some simple screens are displayed here:

http://www.huv.com/uSeeker/smalltalk/screenshots.html

A much more complex editor window, with a direct manipulation scrollable
zoomable draggable graphics pane is here:

http://www.huv.com/roboMagellan/MissionEditor.jpg

I'm pretty happy with what I can do with Morphic... Of course, there are
things that could be better (like the speed), but all in all it is one of
the most flexible GUI architectures I have ever used.

Later,
Jon

--------------------------------------------------------------
   Jon Hylands      [hidden email]      http://www.huv.com/jon

  Project: Micro Seeker (Micro Autonomous Underwater Vehicle)
           http://www.huv.com

Reply | Threaded
Open this post in threaded view
|

RE: Viewing in Morphic (was: Re: The Weekly Juan #4: "Smalltalk, Direct Manipula

J J-6
In reply to this post by Andreas.Raab
>From: Andreas Raab <[hidden email]>
>Reply-To: The general-purpose Squeak developers
>list<[hidden email]>
>To: The general-purpose Squeak developers
>list<[hidden email]>
>Subject: Viewing in Morphic (was: Re: The Weekly Juan #4: "Smalltalk,
>Direct Manipulation and End User   Programming")
>Date: Mon, 13 Nov 2006 20:58:59 -0800
>
<snip>
>
>So, I guess I have to correct myself, Morphic does indeed support viewing
>via step-polling (but I still wouldn't call that a viewing architecture ;-)
>
>Cheers,
>   - Andreas
>

I don't know much about how morphic does it's work, but I definitaley think
polling is bad. :)

I think how Dolphin does it is really nice.  For those who don't know, in
Dolphin they use MVP (Model View Presenter).  The basic difference in the
concept is: the View is responsible for displaying itself, as well as
responding to user events.  The Presenter is the glue between the Model and
the View.  It can recieve events from the View as high level or low level as
it want.  I.e. it can get an event like "user has selected 5 rows and did
(via right click) the 'make bold' command", or it can go as low as asking
for every key press and/or mouse move.

Every model has to be derived from the Model class, and you do have to take
care that if one of your Model methods updates another part of the model
(e.g. the view requests to add a transaction, but this causes the model to
update it's balance), you have to send an event explicity.

As far as the normal model changes, you don't have to send events yourself.  
In the presenter you just create an "Aspect" for each field you are going to
manage.  This part is kind of like Magritte, but you specify the Aspect
(e.g. SelectBoxAspect for enum type values) in the Presenter instead of the
Model.  I believe the Aspect class does a "#send: anEvent on: aModel", to
handle all other views getting updated.  And in this way, you have to send
the event yourself if you call those methods directly, but no polling has to
be done.

This is how I think it works anyway (I didn't know enough about smalltalk at
the time to even check).  I hope it doesn't do polling! :)

_________________________________________________________________
Get today's hot entertainment gossip  
http://movies.msn.com/movies/hotgossip?icid=T002MSN03A07001


Reply | Threaded
Open this post in threaded view
|

Re: The Weekly Juan #4: "Smalltalk, Direct Manipulation and End User Programming"

Stéphane Rollandin
In reply to this post by Aaron Reichow
Aaron Reichow wrote:
> What am I missing? To me, Morphic is about nothing if not flexible and
> reusable. A morph is a morph is a morph.  That said, I do think it can
> be hard to wrap one's head around the first time- but the payoff is
> worth the time invested.

agreed

Stef

Reply | Threaded
Open this post in threaded view
|

Re: The Weekly Juan #4: "Smalltalk, Direct Manipulation and End User Programming"

Mikael Kindborg-2
In reply to this post by Aaron Reichow
On 11/15/06, Aaron Reichow <[hidden email]> wrote:

> I didn't do that by calling a #font: method on the TaskbarClockMorph,
> but I didn't see any need to implement such a thing.  Maybe that is
> the kind of abstraction missing in Morphic according to some folks.
> Rather, I just went to the TaskbarClockMorph instance, asked for the
> text submorph and set its font.  Unlike other widget sets, the new
> morphs I build are composed of other morphs, and it's easy to access
> those submorphs and do what I want to them. My experience on some
> other platforms is just the opposite- I am stuck with what the
> developer thought important enough to put it in the new widget's
> API.  If she thought that I woujldn't need to change the font, I was
> stuck.
>
I would have implemented that font: method, because it abstracts
away the details of the internal structure of the clock morph, and
this tends to pay off in the long run. I also agree that Morphic is
flexible and easy to work with. I usually have a model and use an
observer-type of pattern to update the morphs. When I first saw
Morphic, I was very suspicious of the lack of a model - morphs
seemed to be all UI-objects! Then I realized that this is sometimes
simple and useful, and that it is easy to do your own morph-model
architecture.

Best regards, Micke

Reply | Threaded
Open this post in threaded view
|

Re: Tweak events (was Re: Viewing in Morphic)

Juan Vuletich-4
In reply to this post by Bert Freudenberg
Hi Bert,

Thanks for the explanation.

Cheers,
Juan Vuletich

Bert Freudenberg escribió:

> (separating this from the Morphic discussion)
>
> On Nov 14, 2006, at 11:22 , Juan Vuletich wrote:
>
>> Hi Andreas,
>>
>> Andreas Raab escribió:
>>> I presume that by "the receiver of the message for some object was
>>> always the object triggering the event" you mean that the signaler
>>> and the handler of the event are the same (if not, please clarify).
>> yes.
>>> If that's what you mean then you are right, usually they are not the
>>> same. This is why you have <on: eventName in: signaler> annotations
>>> (and the common <on: eventName> is effectively shorthand for <on:
>>> eventName in: self>).
>>>
>> I missed that. How do you reference signaler? I mean, each instance
>> of the handler could want events from a particular signaler, perhaps
>> one that still doesn't exist when you compile the method! Perhaps it
>> is an instance variable of the handler?
>
> Yes, it is like an instance variable (actually a field, which is used
> exactly like an instance variable but generates change events on
> assignment).
>
> When compiling, only existing instances are updated. But when creating
> a new instance, the field will be nil, so no event handlers will be
> registered for that event, yet. But a second event handler is
> installed that handles a change event for that field - it will
> register the actual event handler as soon as you assign to the field.
>
> This is an example for what Andreas meant with "indeed, part of the
> implementation of Tweak depends on objects 'viewing themselves'". This
> is totally non-graphical, it takes the model/view separation idea down
> to the system core itself.
>
> - Bert -


Reply | Threaded
Open this post in threaded view
|

Re: Resilient (was: The Weekly Juan #4: "Smalltalk, Direct Manipulation and End User Programming")

Lex Spoon
In reply to this post by Francisco Garau
Jecel Assumpcao Jr <[hidden email]> writes:
> Someone mentioned that the language had been changed from Smalltalk, but
> it is impossible to tell from the information on the company site
> (though you can register to download it and see for yourself). A good
> starting point for information about this system is:
>
> http://www.smalltalk.org/versions/OOVM.html


More info here:

  http://wiki.cs.uiuc.edu/Resilient/Issues

This claims, and I had heard, that its blocks cannot be returned or
stored in the heap.  IMHO that is such a major limitation that it is
hardly Smalltalk any longer.


-Lex


Reply | Threaded
Open this post in threaded view
|

Mission Editor

Raymond Asselin
In reply to this post by Jon Hylands

>A much more complex editor window, with a direct manipulation
scrollable
>zoomable draggable graphics pane is here:
>
>http://www.huv.com/roboMagellan/MissionEditor.jpg
>

Hi John, is your MissionEditor code available ?  It seems
interesting to build “mission” or “route” for a GPS. I get a
Garmin GPS.


Reply | Threaded
Open this post in threaded view
|

Re: Resilient (was: The Weekly Juan #4: "Smalltalk, Direct Manipulation and End User Programming")

Francisco Garau
In reply to this post by Lex Spoon
Hi Lex,

>
>  http://wiki.cs.uiuc.edu/Resilient/Issues
>
> This claims, and I had heard, that its blocks cannot be returned or
> stored in the heap.  IMHO that is such a major limitation that it is
> hardly Smalltalk any longer.
>

That limitation was there from the begining. Lars Bak explained in ESUG 2003
that it made the implementation of the Smalltalk interpreter much simpler. I
specially liked the idea because it would make concrete type inference
possible on those systems. And one of his students followed that path

http://blogs.sun.com/ahe/resource/peter-ahe-thesis.pdf

In my opinion, without blocks Smalltalk would taste very differently. But I
must agree with Marcel Weiher when he says that Smalltalk is not a pure OO
language. Because of the blocks it can be characterized as hybrid, mixing
elements from OO and FP.

http://www.metaobject.com/papers/HOM-Presentation.pdf

Cheers,
Francisco


Reply | Threaded
Open this post in threaded view
|

Re: Mission Editor

Jon Hylands
In reply to this post by Raymond Asselin
On Thu, 16 Nov 2006 17:20:35 -0500, Asselin Raymond
<[hidden email]> wrote:

> Hi John, is your MissionEditor code available ?  It seems
> interesting to build “mission” or “route” for a GPS. I get a
> Garmin GPS.

You know, I'm pretty sure I answered this already...

But here goes again...

No, it is part of my autonomous controller code. I could separate it out,
but the model behind the UI is actually the autonomous controller itself,
so it would be a bunch of work.

I'll have a look at the code and see how easy it would be to pull that part
out.

Later,
Jon

--------------------------------------------------------------
   Jon Hylands      [hidden email]      http://www.huv.com/jon

  Project: Micro Seeker (Micro Autonomous Underwater Vehicle)
           http://www.huv.com

Reply | Threaded
Open this post in threaded view
|

Re: Resilient (was: The Weekly Juan #4: "Smalltalk, Direct Manipulation and End User Programming")

Lex Spoon
In reply to this post by Francisco Garau
"Francisco Garau" <[hidden email]> writes:

> Hi Lex,
>
> >
> >  http://wiki.cs.uiuc.edu/Resilient/Issues
> >
> > This claims, and I had heard, that its blocks cannot be returned or
> > stored in the heap.  IMHO that is such a major limitation that it is
> > hardly Smalltalk any longer.
> >
>
> That limitation was there from the begining. Lars Bak explained in ESUG 2003
> that it made the implementation of the Smalltalk interpreter much simpler. I
> specially liked the idea because it would make concrete type inference
> possible on those systems. And one of his students followed that path
>
> http://blogs.sun.com/ahe/resource/peter-ahe-thesis.pdf


I would agree it makes type inference more precise, as does any
language change that narrows down the flexibility of runtime dispatch.
I would argue with the "possible" part, though.  You and I have both
written Smalltalk type inferencers that are not foiled by the presence
of blocks.

Anyway, I had the impression the main motivation was to make the
Resilient run fast, and that type inference benefits were secondary.
After all, Resilient targets less powerful devices.


> In my opinion, without blocks Smalltalk would taste very differently. But I
> must agree with Marcel Weiher when he says that Smalltalk is not a pure OO
> language. Because of the blocks it can be characterized as hybrid, mixing
> elements from OO and FP.

Well, it's pure in the sense that it has all the OO fundamentals,
*and* all the values act like proper objects.  So let's say it's not
"merely" OO instead of it's not "pure" OO.  It takes all of OO, plus
parts of FP.

Anyway, all this said, it sounds like Resilient's blocks are at least
sufficient for the collection methods like do: and select: to work.
Those, IMHO, are some of the most useful applications of blocks in
Smalltalk, the ones I'd miss the most if blocks were removed entirely.


-Lex


12