For Programmers: Free Programming Magazines  


Home > Archive > Smalltalk > March 2007 > MVC example in Squeak









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author MVC example in Squeak
bartosz

2007-03-01, 10:13 pm

I'm new to Smallatlk. I'm trying to implement the simple MVC program in
Squeak. I used the Smalltalk code for the Counter example from this paper:
http://www.ccmrc.ucsb.edu/~stp/PostScript/mvc.pdf
I tried to debug the following in a local workspace:
CounterView open
It fails in the statement
topView controller open
which calls StandardSystemController|open, which calls
ScheduledControllers scheduleActive: self
Here I get:
UndefinedObject(Object)>>doesNotUnderstand: #scheduleActive:
It looks like the global ScheduledControllers is nil. What am I doing wrong?
Am I starting a GUI app in the wrong environment?
Bartosz


cor

2007-03-02, 4:26 am

bartosz wrote:
> I'm new to Smallatlk. I'm trying to implement the simple MVC program in
> Squeak. I used the Smalltalk code for the Counter example from this paper:
> http://www.ccmrc.ucsb.edu/~stp/PostScript/mvc.pdf
> I tried to debug the following in a local workspace:
> CounterView open
> It fails in the statement
> topView controller open
> which calls StandardSystemController|open, which calls
> ScheduledControllers scheduleActive: self
> Here I get:
> UndefinedObject(Object)>>doesNotUnderstand: #scheduleActive:
> It looks like the global ScheduledControllers is nil. What am I doing wrong?
> Am I starting a GUI app in the wrong environment?
> Bartosz
>
>



I'm new to Smallatlk ... trying to implement the simple MVC program ???








Joern Eyrich

2007-03-02, 8:11 am

bartosz wrote:
> ScheduledControllers scheduleActive: self
> Here I get:
> UndefinedObject(Object)>>doesNotUnderstand: #scheduleActive:
> It looks like the global ScheduledControllers is nil. What am I doing wrong?
> Am I starting a GUI app in the wrong environment?


your hunch is probably right. out of the box, squeak starts in the morphic
environment. you can change to the traditional mvc environment by creating and
entering an mvc project.

choose "Project->open...->mvc project" from the background menu (exact phrasing
of menu items may differ with the squeak version you use).

This will create a small window named "Unnamed<x>" on the squeak "desktop".
click it, and it will zoom open. with this, you have entered an mvc project
(probably with a blank desktop). use the background menu to open workspaces and
browsers as needed.

HTH,
Joern
bartosz

2007-03-03, 4:13 am

MVC stands for Model-View-Controller, a popular GUI paradigm pioneered by
Smalltalk.

"cor" <corDEL@exchangenet.net> wrote in message
news:12ufq3ppjsbhp22@corp.supernews.com...
> bartosz wrote:
>
> I'm new to Smallatlk ... trying to implement the simple MVC program ???
>



bartosz

2007-03-03, 4:13 am

Thanks! It makes sense. Except, when I open a worspace in a new MVC project
and right-click on it, the whole thing freezes.
Is there a better free Smalltalk package that I could use?
Bartosz

"Joern Eyrich" <Joern.Eyrich@syngenio.de> wrote in message
news:bsCdncg5lcBanHXYnZ2dnUVZ_s6onZ2d@to
tallyobjects.com...
> bartosz wrote:
>
> your hunch is probably right. out of the box, squeak starts in the morphic
> environment. you can change to the traditional mvc environment by creating
> and
> entering an mvc project.
>
> choose "Project->open...->mvc project" from the background menu (exact
> phrasing
> of menu items may differ with the squeak version you use).
>
> This will create a small window named "Unnamed<x>" on the squeak
> "desktop".
> click it, and it will zoom open. with this, you have entered an mvc
> project
> (probably with a blank desktop). use the background menu to open
> workspaces and
> browsers as needed.
>
> HTH,
> Joern



Cesar Rabak

2007-03-03, 4:13 am

bartosz escreveu:
> Thanks! It makes sense. Except, when I open a worspace in a new MVC project
> and right-click on it, the whole thing freezes.
> Is there a better free Smalltalk package that I could use?
> Bartosz
>

What platform, version of Squeak (including the image) are you using?
bartosz

2007-03-03, 7:06 pm

I'm running the latest Windows XP version. The image is
Squeak3.9-final-7067.

"Cesar Rabak" <csrabak@yahoo.com.br> wrote in message
news:esavk1$bdd$1@aioe.org...
> bartosz escreveu:
> What platform, version of Squeak (including the image) are you using?



Cesar Rabak

2007-03-03, 7:06 pm

bartosz escreveu:
> I'm running the latest Windows XP version. The image is
> Squeak3.9-final-7067.
>

In the same OS with images Squeak3.8.1-beta or Squeak3.8-6665 this
behaviour does not occur.

HTH

--
Cesar Rabak



cor

2007-03-04, 4:11 am

Cesar Rabak wrote:
> bartosz escreveu:
> In the same OS with images Squeak3.8.1-beta or Squeak3.8-6665 this
> behaviour does not occur.
>
> HTH
>
> --
> Cesar Rabak
>
>
>


probably his mouse configuration is not right.
Left corner icon, VM preferences, 3 button mouse.

If he wants another Smalltalk he can try Visualworks.
It comes with a good introduction about the language and a very good
help library than includes using adaptors, dependencies.
cor

2007-03-04, 8:15 am

bartosz wrote:
> MVC stands for Model-View-Controller, a popular GUI paradigm pioneered by
> Smalltalk.

....[color=darkred]



So as a new to Smalltalk you are trying to implement the simple MVC
program? as in ... create a new one from scratch? or as in learning how
to use the MVC scheme?
MVC is a little old now. That is why you have to go dig it out in
Squeak. I think VisualWorks, that had a good implementation of it but
has turned into something else.
In VisualWorks, go to the help menu, look for the Adaptor examples
Look for the Adaptor implementation in a Browser.





Cesar Rabak

2007-03-04, 7:10 pm

cor escreveu:
> Cesar Rabak wrote:
>
> probably his mouse configuration is not right.
> Left corner icon, VM preferences, 3 button mouse.
>
> If he wants another Smalltalk he can try Visualworks.
> It comes with a good introduction about the language and a very good
> help library than includes using adaptors, dependencies.

If I read correctly one of OP's earlier posts, he's sing a free
Smalltalk.
Cesar Rabak

2007-03-04, 7:10 pm

cor escreveu:
> bartosz wrote:
> ...
>
>
>
> So as a new to Smalltalk you are trying to implement the simple MVC
> program?


He is starting in Smalltalk but not in programming, perhaps?

The example he's trying is from a 'cookbook' instructions from an
article, and besides the (correct) source for that particular example is
available in Net.

Claus Dragon

2007-03-04, 7:10 pm

Words to the wise, Cesar Rabak <csrabak@yahoo.com.br> wrote:


[color=darkred]
>If I read correctly one of OP's earlier posts, he's sing a free
>Smalltalk.


Not to make too fine a point, but VisualWorks can also be freely used,
for non-commercial projects.

But yes, if the OP wants to use Squeak, then help should occur in that
dialect.
--
Claus Dragon <clauskick@mpsahotmail.com>
=(UDIC)=
d++ e++ T--
K1!2!3!456!7!S a27
"Coffee is a mocker. So, I am going to mock."

- Me, lately.
Cesar Rabak

2007-03-04, 10:11 pm

Claus Dragon escreveu:
> Words to the wise, Cesar Rabak <csrabak@yahoo.com.br> wrote:
>
>
>
>
> Not to make too fine a point, but VisualWorks can also be freely used,
> for non-commercial projects.


More or less... one of the restrictions they put, namely that in the Non
Commercial version you cannot build an executable but have to send the
whole environment together the application you develop will make it
useful only for internal (non commercial) projects.

Alas, the same happens with Dolphin where you cannot produce executables
with the Community Edition.

I don't remember the restrictions on Smalltalk/MT, although IIRC they
don't have a concept of 'community' edition.

Another Smalltalk OP might try is ST/X which is more similar to ST-80
(canonical MVC, for example) and less restrictive licensing.

>
> But yes, if the OP wants to use Squeak, then help should occur in that
> dialect.


Agreed.

Regards,

--
Cesar Rabak
Joern Eyrich

2007-03-07, 8:30 am

ok, when I use this version I get the same problem...
usually, when the system goes into an infinite loop or something like that you
can get into a debugger by typing "alt-.", but in this case the vm exits without
even a debug log file (i think i see an emergency evaluator/console thingie pop
up briefly, but I can't make out what it says...)

as a lame workaround, you could use keyboard commands for the moment (alt-d for
"Do it", for example)

maybe you could try an earlier version? sorry, I don't have one on the computer
I currently use, so I can't advise how far you should go back.

to get more help, you should ask on the Squeak developer's list (see
http://lists.squeakfoundation.org/m...info/squeak-dev)

also, please file a bug for this on http://bugs.impara.de/

sorry I can't be of more help.

bartosz wrote:
> I'm running the latest Windows XP version. The image is
> Squeak3.9-final-7067.
>
> "Cesar Rabak" <csrabak@yahoo.com.br> wrote in message
> news:esavk1$bdd$1@aioe.org...
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com