[squeak-dev] Mouse button tester question

marcel.taeumel Marcel.Taeumel at hpi.de
Thu Jun 29 17:23:50 UTC 2017

marcel.taeumel wrote
> Hi, Hannes.
> The generic event handler, which can be configured via #on:send:to:, kicks
> in at the level of Morph >> #mouseDown: here. For historic reasons, the
> halo invocation kicks in earlier at the level of Morph >>
> #handleMouseDown:. Well, since #handleMouseDown: is considerend framework
> code and #mouseDown: application code, this is a good thing because
> applications cannot easily overwrite the halo functionality. However, we
> should, for the future, make the means of interaction for halo invocation
> configurable so that there is a chance for applications to make use of the
> blue button at all. For example, if you do not need [CMD]+[SHIFT]+[B] in
> your application, you may want to re-map halo invocation to that. :-) An
> event filter could be used to achieve this.
> Best,
> Marcel

Hi, there.

Please find attached a change set that extracts the global interaction
mechanisms "halo" and "meta menu" as event filters into PasteUpMorph (i.e.
the world morph).


This change makes some Morph code cleaner and the following example work as

m := Morph new.

m wantsHaloFromClick: false.
m wantsYellowButtonMenu: false.
m wantsMetaMenu: false.

m on: #mouseDown send: #value: to:[:evt|
        evt redButtonPressed ifTrue:[m color: Color red].
        evt yellowButtonPressed ifTrue:[m color: Color yellow].
        evt blueButtonPressed ifTrue:[m color: Color blue]


View this message in context: http://forum.world.st/Mouse-button-tester-question-tp4941095p4952954.html
Sent from the Squeak - Dev mailing list archive at Nabble.com.

More information about the Squeak-dev mailing list