Quit Squeak with code?

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

Quit Squeak with code?

Marcus Pedersén
Hi!
If I want to quit Squeak , for example have a "Quit button", how do I  
do it with code instead of bringing worldmenu up?

Many thanks!
Marcus

Reply | Threaded
Open this post in threaded view
|

Re: Quit Squeak with code?

vaidasd
Smalltalk snapshot: true andQuit: true

Vaidotas Didžbalis


Reply | Threaded
Open this post in threaded view
|

Re: Quit Squeak with code?

Ken Causey-3
In reply to this post by Marcus Pedersén
On Fri, 2006-03-03 at 14:26 +0100, Marcus Pedersén wrote:
> Hi!
> If I want to quit Squeak , for example have a "Quit button", how do I  
> do it with code instead of bringing worldmenu up?
>
> Many thanks!
> Marcus

Let's do a little teaching to fish here. ;)

1.  Bring up the world menu.

2.  Bring up a halo by clicking on the 'quit' menu item in the world
menu with the appropriate button.  I believe this is the third mouse
button in general but you may have to experiment with this.  The halo is
a set of variously colored round buttons with icons that appears around
the Morph.

3.  Click once more on the 'quit' menu item with the same mouse button
which should 'shrink' the halo so it is only surround this specific item
in the menu.

4.  Left click the 'red' halo button in the upper left.  This will bring
up a menu.

5.  From this menu choose 'debug...' and then 'inspect morph' or
'explore morph'.  Either will work and is somewhat a matter of
preference.  I'm going to continue as if 'inspect morph' were selected.

6.  This brings up an inspector on the MenuItemMorph that represents the
'quit' selection from the World menu.  You can verify this by selecting
the 'contents' variable from the left pane.

7.  Now look at the target, selector, and arguments variables.  These
specify a message (selector) which is sent to a receiver (target) with
the specified arguments.

8.  If you open a browser and search for the TheWorldMenu class and look
at the instance side methods (the value of target is 'a TheWorldMenu')
and select 'doMenuItem:with:' from the list of methods (it happens to be
under the 'action' category) and examine it you will find that it sends
the message in the second position of the arguments Array to the
receiver in the first position.  The receiver is again 'a TheWorldMenu'
and the message is 'quitSession'.  You will find this in the 'commands'
category of the TheWorldMenu instance methods.

9.  From this point I think you can find your answer.

Ken



signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Quit Squeak with code?

Enrico Schwass
Hello Ken,

I am sure, that most of the people like this kind of help.
Me too. Please do this more often, if you have time

Is there a "teaching corner", that summarizes version-independent
concepts and daily work shortcuts??

A smalltalk quiz is what I really like to see.
The ruby community has a weekly one. I never posted to it, but learned a
lot from the solutions. And the following discussions. see
www.rubyquiz.com

> Let's do a little teaching to fish here. ;)
> 1.  Bring up the world menu.
> 2.  Bring up a halo by clicking on the 'quit' menu item in the world
> menu with the appropriate button.  I believe this is the third mouse
> [...]

Thank you
Enno