Edward ffolliott Hull wrote:
> http://effh.homeip.net/subsector.png
Ohh... I see.
> (I won't leave the server up indefinitely, it is noisy so I need somewhere
> quieter/less used than my sitting room for it.)
In case the image does go away, for the benefit of our
readers in the future -- basically, you've got a honeycomb
graphic, where all the hexagons are in a mesh. Ascii art:
/ \__/ \__/ \__/ \__/ \__/
\__/ \__/ \__/ \__/ \__/ \
/ \__/ \__/ \__/ \__/ \__/
\__/ \__/ \__/ \__/ \__/ \
/ \__/ \__/ \__/ \__/ \__/
\__/ \__/ \__/ \__/ \__/ \
/ \__/ \__/ \__/ \__/ \__/
\__/ \__/ \__/ \__/ \__/ \
/ \__/ \__/ \__/ \__/ \__/
\__/ \__/ \__/ \__/ \__/ \
/ \__/ \__/ \__/ \__/ \__/
Yes, seems like what you should probably do is not make
separate widgets at all.. just draw your graphic, and
calculate where mouse clicks are on the mesh. This way
you can have a single callback for the whole grid, and
use the x/y coordinates to figure out which cell was clicked on.
I think that's the easiest; make a handle() method that
looks for FL_PUSH, and use Fl::event_mouse() to determine
the button pressed, and use Fl::event_x() and Fl::event_y()
to get the x/y position.
I assume you can figure out the math that can turn an x/y
position into a cell number.
One trick we used to do on the SGIs with 'old gl'
(before opengl was invented), you could put the buffer
into, I think it was called 'pick mode', where you could
draw your entire scene, and the buffer would figure out which
polygons drew underneath your mouse, and would return the
index numbers of the polys that were under it.
I'm not sure if opengl has this.. if it does, then maybe
you could do it as an opengl graphic. Then the shapes could
be /completely/ arbitrary, and even scaled, zoomed, rotated
into perspective, etc.
I've been too long away from gl apps, and I'm not sure such
a feature is available anymore.
> By the way Greg, Thank you for responding and even more thanks for your
> fltk cheat page, it has been a lot of help.
Sure, glad it's helped..
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk