[FIX]MenuItemMorph Re: Small teaser for morphic internals experts

Karl Ramberg karl.ramberg at chello.se
Fri Aug 18 17:47:52 UTC 2000


It didn't checked its intance variable isSelected so it kept on deselecting.

Karl

Hey, I'm an expert :-)

Mike Rutenberg wrote:

> When I bring up a menu (on a slower machine), it subtly but repeatedly flashes the nearest MenuItemMorph while the cursor is over the menu border.
>
> I would not even call this a bug.  This is likely small and not important, but I have tried and failed to find the origin with my present understanding of morphic internals.  Which makes me more curious.
>
> Details below.
>
> Mike
>
> You can not see the flashing on a fast machine, unless you enable display of the morphic damage regions (in WorldState displayWorld:submorphs:).
>
> Bring up a menu, such as the main "World" menu.  Do not move the mouse at all. You will see that the first MenuItemMorph (Keep this menu up) flashes continuously.  The flashing seems to happen whenever you are over one of the blue lines, such as border or internal menu lines.  Interestingly the flashing stops after you select (keep this menu up).
>
> I'm using Win95 --  2.8 or 2.9 update2492
-------------- next part --------------
'From Squeak2.9alpha of 13 June 2000 [latest update: #2518] on 18 August 2000 at 7:39:41 pm'!

!MenuItemMorph methodsFor: 'events' stamp: 'kfr 8/18/2000 19:37'!
mouseMove: evt
	| m |
	m _ evt hand recipientForMouseDown: evt hand lastEvent.
	m == self
		ifTrue: [isSelected ifFalse: [m selectFromHand: evt hand]]
		ifFalse: [isSelected ifTrue:[self deselectForNewMorph: m].
				((m isKindOf: MenuItemMorph) and: [m isInMenu]) ifTrue:
					[m selectFromHand: evt hand]].! !



More information about the Squeak-dev mailing list