Skip to content

Commit

Permalink
ButtonGroups.getSelected
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Feb 5, 2024
1 parent 8a7846b commit 581b122
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions haxe/ui/components/Button.hx
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,19 @@ class ButtonGroups { // singleton
return _groups.get(name);
}

public function getSelected(name:String):Button {
var list = get(name);
if (list == null) {
return null;
}
for (button in list) {
if (button.selected) {
return button;
}
}
return null;
}

public function set(name:String, buttons:Array<Button>) {
_groups.set(name, buttons);
}
Expand Down

0 comments on commit 581b122

Please sign in to comment.