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@0 corner: 1@1). topView controller open.
-------------------------- Mark Guzdial : Georgia Tech : College of Computing : Atlanta, GA 30332-0280 (404) 894-5618 : Fax (404) 894-0673 : guzdial@cc.gatech.edu http://www.cc.gatech.edu/gvu/people/Faculty/Mark.Guzdial.html
Mark Guzdial wrote:
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@0 corner: 1@1). topView controller open.
Mark Guzdial : Georgia Tech : College of Computing : Atlanta, GA 30332-0280 (404) 894-5618 : Fax (404) 894-0673 : guzdial@cc.gatech.edu http://www.cc.gatech.edu/gvu/people/Faculty/Mark.Guzdial.html
Many thanks Mark. The window seems to have the same size as the Workspace. I wonder why.
Philippe de Rochambeau
squeak-dev@lists.squeakfoundation.org