FLTK logo

Re: [fltk.general] Select only one button?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Select only one button? imm Jun 23, 2021  
 
On Wed, 23 Jun 2021, 18:14 supsm17 wrote:
Is it possible to get the currently selected button, or do I have to do that manually with callbacks?

There's a couple of ways to get that.
Individual callbacks is certainly one way. 
Or you can store your buttons in an array then poll the array to see which is set.
What I usually do is have the buttons share a callback (the user data id's each button) and store the last selected ID for easy access.
But there's myriad other ways, which may well be better!
--
Ian
From my Fairphone FP3

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/CAGFM6dbJ9Cgyb_L5Q3qtdU4jn_HqjKC7Cc203fHah1uswsGaiA%40mail.gmail.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.