PolygonMorph balloon text

Frank Shearar Frank.Shearar at rnid.org.uk
Tue Jan 11 16:01:11 UTC 2005


I'm writing an NCSA image map editor. I've got an ImageMorph holding the image, and to it I add Morphs for each entry in the map file. Thus when you're editing the map you see polygons, rectangles, circles overlaid on the image. All nice and neat.

So I realised that you will want to know what region points to what URL, so I thought I'd use a balloon text. It was trivial to do this for EllipseMorphs and BorderedMorphs (for the circle & rect entries, respectively, of course). But I found that my polygonal regions don't work quite as nicely. Each ImageMapEntry has an #asMorph, and ImageMapPolygonEntry>>asMorph looks like this:

asMorph
	| p |
	p := PolygonMorph
		vertices: self points
		color: Color transparent
		borderWidth: 1
		borderColor: Color black.
	p setBalloonText: self targetUri asString.
	^ p.

When I hover the mouse within the region though I don't see the balloon text. It's only when I hover the mouse over the lines in the polygon (the borders of the region, if you like) that I see the balloon text.

Thus my question: How can I have the balloon text show up when the mouse hovers anywhere within the bounds of the polygon?

I've tried searching, and got as far as Morph>>handleMouseEnter: which calls HandMorph>>triggerBalloonFor:after - I thought perhaps PolygonMorph overrode something to make mouse hover balloon texts behave the way they do, but I couldn't find anything.

frank


*******************************************************************
This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to
whom they are addressed. Any views or opinions expressed
are solely those of the author and do not necessarily represent
RNID policy.
If you are not the intended recipient you are advised that any
use, dissemination, forwarding, printing or copying of this
email is strictly prohibited.
If you have received this email in error please notify the RNID
Helpdesk by telephone on: +44 (0) 207 296 8282.
The Royal National Institute for Deaf People
Registered Office 19*23 Featherstone Street
London EC1Y 8SL No. 454169 (England)
Registered Charity No. 207720
********************************************************************




More information about the Squeak-dev mailing list