[Cuis-dev] Morphic button clicks

Mark Volkmann r.mark.volkmann at gmail.com
Thu Jun 6 14:24:28 PDT 2024


I'm trying to learn how to create a button and have something happen when
the button is clicked. I've done a lot of Googling for this, but haven't
found the solution.
Here is what I tried based on example code I found:

s1 := Switch new.
btn := PluggableButtonMorph model: s1 action: [Transcript show: 'got
click'] label: 'Click Me'.
btn color: (Color blue); enableLabelColorWith: (Color yellow).
btn openInWorld.

Perhaps I don't really need to create a `Switch`. I hope I don't, but it
seems all the creation methods for `PluggableButtonMorph` require that.
I'm not sure if `PluggableButtonMorph` is the class I should be using.
This code does create and render a button, but it does not set the label
color to yellow and I get the following error when I click the button:

BlockClosure(Object)>>doesNotUnderstand: #asPlainString

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240606/5c1a1fa2/attachment.htm>


More information about the Cuis-dev mailing list