RE: [fltk.general] Problems using Fl_Widget->user_data() [General Use]

9 views
Skip to first unread message

MacArthur, Ian (Leonardo, UK)

unread,
Sep 8, 2016, 4:55:43 AM9/8/16
to fltkg...@googlegroups.com

> > I'm trying to process multiple buttons with one callback, so I I want
> to
> > use user_data() to store the button's name / identifier


> This is one way to handle this, but there is another possibility:


And of course, each button (probably) already has a unique identifier string stored in its label() field anyway, which also might be used to identify the buttons in the callback.

Indeed, ISTR that one of Greg's examples shows pretty much that approach?


Hmm, maybe this one?

http://www.seriss.com/people/erco/fltk/#TouchScreenNumPad

or maybe here

http://www.seriss.com/people/erco/fltk/#Mandelbox

Dunno...

And there's some related stuff about manipulating menu callback based on the label too...



Selex ES Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

Will B

unread,
Sep 8, 2016, 11:56:34 AM9/8/16
to fltk.general, ian.ma...@leonardocompany.com

Thank you for that, however I don't want to rely on the label contents in case I later want to implement localisation.  I simply didn't understand that user_data() and the (void* p) for callbacks were one and the same.

Thank you! :-)

Will Brokenbourgh
Reply all
Reply to author
Forward
0 new messages