Thu, 17 Apr 2025 10:33:05 +0200
radio button indices should start at 1 (Cocoa)
| ui/cocoa/button.m | file | annotate | diff | comparison | revisions |
--- a/ui/cocoa/button.m Thu Apr 17 10:27:49 2025 +0200 +++ b/ui/cocoa/button.m Thu Apr 17 10:33:05 2025 +0200 @@ -252,17 +252,17 @@ int64_t index = 0; for(UiRadioButton *b in buttons) { if([b cell].state != 0) { - i->value = index; + i->value = index + 1; break; } index++; } - return index; + return i->value; } void ui_radiobuttons_set(UiInteger *i, int64_t value) { NSMutableArray *buttons = (__bridge NSMutableArray*)i->obj; - int64_t index = 0; + int64_t index = 1; for(UiRadioButton *b in buttons) { if(index == value) { [b cell].state = NSControlStateValueOn;