Object>>currentHand vs. Project class>>returnToPreviousProject

Andreas Raab andreas.raab at gmx.de
Sat Jul 19 14:58:49 UTC 2003


Ned,

You're right. Upon returning from an MVC project we need to set ActiveHand
to something valid. Probably in Project>>enter:revert:saveForRevert:
something along the lines of:

	(world isMorph and:[ActiveHand == nil]) ifTrue:[
		"make sure we have a valid hand for Morphic"
		ActiveHand := world primaryHand.
	].

should do the trick. It's funny we never ran into that before - seems like
not too many people use MVC projects anymore ;)

Cheers,
  - Andreas

> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org 
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org] On 
> Behalf Of Ned Konz
> Sent: Saturday, July 19, 2003 4:39 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: Object>>currentHand vs. Project 
> class>>returnToPreviousProject
> 
> 
> The comment in Object>>currentHand reads:
> 
> "Return a usable HandMorph -- the one associated with the object's 
> current environment.  This method will always return a hand, even if 
> it has to conjure one up as a last resort.  If a particular hand is 
> actually handling events at the moment (such as a remote hand or a 
> ghost hand), it will be returned."
> 
> However, it no longer does that. Instead it returns ActiveHand, which 
> happens to not be set when returning from an MVC project to a Morphic 
> project (via Project class>>returnToPreviousProject).
> 
> Likewise, "World activeHand" or "self world activeHand" (from the 
> point of view of a Morph in the world you're returning to) is nil.
> 
> This is mostly no big deal (though I just got bit by it in the 
> HandMagnifier), but should we:
> 
> (A) fix the comment, or 
> (B) fix the behavior to return a new HandMorph if ActiveHand is nil
> 
> -- 
> Ned Konz
> http://bike-nomad.com
> GPG key ID: BEEA7EFE
> 
> 



More information about the Squeak-dev mailing list