Greg Ercolano wrote:
> 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..

Thank-you all for your replies.

you've given me plenty to think about and I believe I have enough
information to get this all working nicely. I'll let you know how I get on.
I will probably investigate Matthiasm's suggestions first as this leaves
the existing data-structures intact (attached to each button is the data
that prompts drawing of the extra details on one of the hexes in the pic
posted previously), but Greg and Ian, your suggestions make a very
viable fall-back in the event that I can't get the individual hexes
working. In many ways I wish I thought of that first before taking the
individual widgets approach.
Either way, I'm learning, so whatever happens will be worth the effort.

-- 
-Ted
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to