Need Help with PluggableButtonMorph
Stephane Ducasse
ducasse at iam.unibe.ch
Sun Jan 26 17:17:48 UTC 2003
Hi guys
can somebody help me with the following problem (I spent really too
much time on it)?
I have a window with PlugabbleButtonMorph buttons, when I open the
window, the buttons are in a down position (I would like them to be in
up at start time), when I click on the buttons they do up/down/up and
stay in up position after. This means that the user sees a difference
whether he pressed or not on a button.
My buttons do not need a model so I did not pass one. Should I? I pass
getState: nil thinking that it could work as follow. I checked the code
and apparently PBM checks that carefully
| button |
button := PluggableButtonMorph
on: self
getState: nil
action: #clearAllAction.
button label: 'Clear All'.
self colorizeButton: button.
^ button
I tried all kinds of stuffs such as to pass a method returnTrue as
argument of the getState
getState: #returnTrue
returnTrue
^ true
I tried also the feedbackColor: method to have some feedback when I
press on a button but
nothing happened.
As I only needed a stupid buttons that trigger a method on a target I
tried to use other buttons such as SimpleButtonMorph until I realized
that addMorph:frame... control their color (I hate that). So I could
not define the color ***I*** wanted for them.
So a really bad sunday afternoon.........When will squeak have a decent
UI widget set, with comments on the class? I have the impression that
this will never happen.
If you want to try....With the following code try MicroWorkspace new
openAsMorph and click on the leftmost button (I shortcut its action,
the other should normally break in your image because the other classes
are not included)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MicroWorkspace.st
Type: application/text
Size: 56999 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030126/0c71a981/MicroWorkspace.bin
-------------- next part --------------
Thanks back writing....boring books....
stef
Prof. Dr. St?phane DUCASSE (ducasse at iam.unibe.ch)
http://www.iam.unibe.ch/~ducasse/
"if you knew today was your last day on earth, what would you do
different? ... especially if, by doing something different, today
might not be your last day on earth" Calvin&Hobbes
More information about the Squeak-dev
mailing list
|