[squeak-dev] problem with MenuMorph like morphs
K K Subbu
kksubbu.ml at gmail.com
Fri Mar 27 08:35:50 UTC 2020
On 27/03/20 10:02 AM, Ralph Boland wrote:
> I sometimes need an M morph to act similar to a MenuMorph; that is
> the M morph
> can be made to display on command, say from pressing some button.
Every Morph can have its own event handler (see on:send:to).
MenuMorph manages a collection of such MenuItems (a button or a sub-menu).
If your button is rectangular with border and string label, use
SimpleButtonMorph (comments has examples).
If the label is an icon (Form), look at IconicButton. You can create
your own icon by using Do->Form fromUser bitEdit.
Use PluggableButtonMorph if you building a tool pane.
> Where can I set a breakpoint so that I can investigate why nothing
> happens when I click
> on a ItemMorph instance submorph of an M morph on the screen?
The foreground process that handles UI events can be observed using
Tools->Process Browser. This process uses HandMorph to direct events to
specific morphs on the screen. You can use HandMorph>>showEvents to turn
on/off events tracing. See
http://forum.world.st/Button-tracking-Morph-td63492.html
> Notes:
> 1) When my M morph is first displayed there is at the top a balloon that says:
>
> Enter text to narrow selection
> down to matching items
>
> I didn't intend for this balloon to occur but it got picked up somehow.
> It would be useful to know how to change its text or remove it. I
> point it out here only because
> it may help explain what is happening.
See http://wiki.squeak.org/squeak/2332 for a well-written example of an
interactive morph.
HTH .. Subbu
More information about the Squeak-dev
mailing list
|