From 554bccbecdc2acdc73fd1ff851c541839ed8b523 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Wed, 17 Jan 2024 19:47:41 +0100 Subject: Synchronize mouse and keyboard callbacks for Fl_Button (#877) Keyboard behavior for button types was not consistent with mouse click behavior. This change avoids callbacks when pressed radio buttons are pressed again. --- test/radio.fl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/radio.fl b/test/radio.fl index 13ef9bfd0..f21c02b0d 100644 --- a/test/radio.fl +++ b/test/radio.fl @@ -6,15 +6,17 @@ Function {button_cb(Fl_Button *b, void *)} { comment {Buttons test callback} open private return_type void } { code {char msg[256]; -sprintf(msg, "Label: '%s'\\nValue: %d", b->label(),b->value()); +sprintf(msg, "Label: '%s'\\nValue: %d\\nChanged: %d", + b->label(), b->value(), b->changed()); cb_info->value(msg); cb_info->redraw(); -printf("%s\\n",msg);} {} +printf("%s\\n",msg);} {selected + } } Function {} {open } { - Fl_Window {} {open selected + Fl_Window {} {open xywh {470 366 369 214} type Double visible } { Fl_Button {} { -- cgit v1.2.3