[FIX] [ENH] TargetSighter-wiz ( [cd][er][et] Is there a customer for this cs? )

Peace Jerome peace_the_dreamer at yahoo.com
Sun Nov 21 01:06:26 UTC 2004


--- tomkoenig_at_mindspring.com wrote:

> 
> I was unable to find "Target Offset needs a hand"
> bug in BFAV. 

It is in Squeak dev. Since part of it was written as
[BUG] report I don't think that part got to BFAV.  I
was (still am) a newbie at reporting things.

Here is the updated jist of the bug:

[BUG] SetTarget misses

a version of this appear in sqeuakdev under the tiltle
[BUG] TargetOffset needs a hand.


How do you set the target on a slider or a button or a
...

There is an entry in the menu for setting the target
if it can find one.
Which uses:

(self world rootMorphsAt: aHandMorph targetOffset)
size > 1
		ifTrue: [aCustomMenu add: 'set target' translated
action: #setTarget:].


	
	Now rootMorphsAt: expects a relevant point in world
as its argument. What has been passed to it instead is
the dinky target offset. Which gives a irrelvant
location unless the hand position happens to be 0 at 0
anyway (on a 1024x786 screen what are your chances.)
So the only way to get the menu item to appear is to
place two copies of your target in the upper right
hand corner of your screen and bring up the red menu
on the slider.
	
	I don't think this is what anyone really intended.
This bug has been around so long its aquired viral
qualities.The phrase
	 (self world rootMorphsAt: aHandMorph targetOffset)
appears to have been adopted by most of the target
setters.
	
	This is probably one of the reasons Button porperties
is not working.
	
	MenuMorph
	SimpleButtonMorph
	SimpleSliderMorph
	and
	StringButtonMorph
	>>setTarget: all use this phrase
	the latter three use it in
	>>addCustomMenuItems:hand:  to test for a settable
target.
	
	as does MovieMorph: (also in >>insertIntoMovie:).
	
The correct argument is probably (hand pos - hand
targetOffset) but the whole shebang wants to be
factored into something like hasTarget and
aquireTarget. (Note: I later tried variations of
points but did not seem to be able to improve things.
I finally realized i wanted the menu to work similar
to “embed into” and designed a fix along those lines.)

Meta criticism sidebar:
	
	I am trying to program my stuff and besides being
unsure of what the correction actually is I am a
little angry that the care takers of squeak have taken
so little care. Hopefully one of the responsible
parties for the perpetuation of this bug will take
responsibility for tracking down implementing and
testing the fix.  

Please note that this is a stealth bug that users
can't see because the hasTarget test will fail hiding
the menu item that would cause the bugged aquireTarget
code to noisily fail. I wonder if the tests were added
as a "bug fix" in the first place.  
	
	The meta on this is that squeak desprately needs code
reviewers to look at and run thru the code. Designate
what is good bad or ugly code and start fixing or
excising the ugliest.
	
	In theory squeak smalltalk is a dream to work with,
In practice I'm finding its a bug garden. Its not
really worth making a commitment to improving squeak
unless there is a commitment on the part of its
keepers to get rid of the bugs and to find ways of
preventing them from being introduced.

I wrote the above in the heat of frustration and
tiredness.  In a more curious spirit I later went back
and solved the problem for SimpleSliderMorph by
creating the target sighter.

Yours in service, -Jerome Peace
	
	
 
> I tested in Squeak3.8b-6374 and it looks okay but
> I'm not really sure if
> there is user for this enhancement. 

I've heard this before.  And I'm still surprised that
the power of this is not obvious to others. However, I
realize its my responsiblilty to (re)sell it. Attached
is the latest version (The only thing I changed was
the shape of the target sight.) A simple play with
me project can be found in my bug report on mantis
(#0000503). The project was too big to attach to a
squeakdev mailing. 

>This is
> larglely additional
> protocol to six different classes.
> If there is a desire for this, then I believe it can
> safely be included.

Thank you --Jer

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Squeak-dev mailing list