[squeak-dev] Re: generalizedYellowButtonMenu

Chris Muller asqueaker at gmail.com
Wed Sep 9 23:40:57 UTC 2009


Hi, I've had the exact same problem ever since 3.9.  The problem
manifests if you want to handle the yellow button in MyCustomMorph,
when it is embedded in a standard Morph, such as RectangleMorph.

For Maui, I tried so hard to find a solution that would allow
MyCustomMorph to intercept and respond to the yellow button with my
own handler, that would not require a change to core 3.9 Squeak code.

I was unsuccessful.  To do the above, I had to revert:

  Morph>>#mouseDown:

to the version from 3.8.  Specifically, you may simply delete these
lines that were erroneously added in 3.9:

	evt yellowButtonPressed
		ifTrue: ["First check for option (menu) click"
			^ self yellowButtonActivity: evt shiftPressed].

but be sure to _keep_ these original lines from 3.8, of course:

	self eventHandler
		ifNotNil: [self eventHandler mouseDown: evt fromMorph: self]

This, btw, also restores the correctness of the methods *comment*,
which also became wrong when the 3.9 change was introduced.

I have been running with this fix in my 3.9 image for 2 years with no
ill-side-effects, but with proper eventHandling for the yellow button
(not to mention cleaner code).

Cheers,
  Chris


On Tue, Sep 8, 2009 at 10:57 PM, Andreas Raab <andreas.raab at gmx.de> wrote:
> Elöd Kironský wrote:
>>
>> Can someone please explain what is the preference
>> "generalizedYellowButtonMenu" for? It is by default enabled in Squeak and it
>> breaks the yellowButtonPressed event in mouseDown: methods. I've tried to
>> Google it, but the only thing I found, that it makes problems in other
>> packages too. Am I missing something? This was introduced somewhere in 3.9 I
>> think, but I'm not sure where and why. Does someone know? Thanks in advance,
>
> It enables the use of context (yellow button) menus on arbitrary Morphs. I'm
> not sure what you mean by "it breaks the yellowButtonPressed event in
> mouseDown: methods" though. Do you have a more specific description of the
> problems you are encountering?
>
> Cheers,
>  - Andreas
>
>



More information about the Squeak-dev mailing list