Small Squeak 3.7 image
Geza Lakner MD
geza67 at freestart.hu
Tue Feb 15 19:59:08 UTC 2005
Dear Paul!
> http://www.napri.sk/squeak/Squeak3.7-small.1.zip
This little beast is obviously a piece of work! Congratulations from
me, too!
I tried to play around a bit with it and loaded a small piece of
morphic code. Unfortunately the MenuMorphs's menu selection
add:target:selector:argument: method does not work :-(((
init
w := SystemWindow new.
t1 := TextMorph new extent: 100 @ 20; position: 50 @ 50; backgroundColor: Color lightBlue; borderWidth: 2;
on: #keyStroke send: #keyPressed to: self.
t2 := TextMorph new extent: 100 @ 20; position: 50 @ 80; backgroundColor: Color lightBrown ; borderWidth: 1.
b := SimpleButtonMorph new target: self; label: 'Button';
actionSelector: #invokeMenu; extent: 80 @ 20; position: 100 @ 140.
w addMorph: t1; addMorph: t2; addMorph: b; bounds: (20 @120 extent: 250 @ 250); setLabel: 'Hello world'.
m := MenuMorph new.
m
add: '1. choice' target: self selector: #menu: argument: 1;
add: '2. choice' target: self selector: #menu: argument: 2;
add: '3. choice' target: self selector: #menu: argument: 3.
^w
When pressing the button in the generated dialog the menu appears but
disappears after a new click without executing the menu: handler.
Would you be so kind and elucidate the happening? Have you also
cleared some message dispatching code from the image? (I browsed the
MenuMorph code but seemingly the add:... methods are there yet.
Bye, Géza
More information about the Squeak-dev
mailing list
|