Window with buttons

Philippe de Rochambeau pr1 at club-internet.fr
Mon Feb 2 15:47:54 UTC 1998


> At 11:58 AM 2/2/98, Philippe de Rochambeau wrote:
> >How do you create a simple application window containing a button, in Squeak?
> >I could not find a Window class in Squeak and the View class's information is
> >quite cryptic to the uninitiated.
> 
> Here's the simplest one window and one button that I know of.  (But I still
> haven't figured out how to make the window open up smaller.)
> 
>         | topView aButton |
>         topView := StandardSystemView new
>         label: 'Silly Window'.
>         aButton := Button newOff onAction: [Smalltalk beep].
>         topView addSubView: (SwitchView new
>                 label: 'Beep' asParagraph;
>                 insideColor: Color gray;
>                 model: aButton; borderWidth: 1) viewport: (0 at 0 corner: 1 at 1).
>          topView controller open.
> 

I have just found out how to set the window's size: send the minimumSize:
method to either the StandardSystemView or the SwitchView. Now here are some
more questions:

- is there any way to set the button's size so that it does not cover the
window's entire area?

- how do you juxtapose several buttons in the same window?

- how do you tell Squeak to give the buttons a border?

(Basically, what I am trying to do is figure out how to create basic user
interface items in a window).

Many thanks.

Philippe de Rochambeau





More information about the Squeak-dev mailing list