Added GetCheckboxChangedListeners function

This commit is contained in:
Alexei Anoshenko 2024-09-03 14:51:19 +03:00
parent e65c04188c
commit 6afb518645
3 changed files with 9 additions and 2 deletions

View File

@ -3,7 +3,7 @@
* Added ModSize, RemSize, RoundSize, RoundUpSize, RoundDownSize, and RoundToZeroSize functions
* Added Start, Stop, Pause, and Resume methods to Animation interface
* Added "transform" property and Transform interface
* Added OpenRawResource function
* Added OpenRawResource, GetCheckboxChangedListeners functions
* Added RemoveClientItem method to Session interface
* Added NewPath and NewPathFromSvg methods to Canvas interface
* Removed NewPath function

View File

@ -355,3 +355,10 @@ func GetCheckboxVerticalAlign(view View, subviewID ...string) int {
func GetCheckboxHorizontalAlign(view View, subviewID ...string) int {
return enumStyledProperty(view, subviewID, CheckboxHorizontalAlign, TopAlign, false)
}
// GetCheckboxChangedListeners returns the CheckboxChangedListener list of an Checkbox subview.
// If there are no listeners then the empty list is returned
// If the second argument (subviewID) is not specified or it is "" then a value from the first argument (view) is returned.
func GetCheckboxChangedListeners(view View, subviewID ...string) []func(Checkbox, bool) {
return getEventListeners[Checkbox, bool](view, subviewID, CheckboxChangedEvent)
}

View File

@ -375,7 +375,7 @@ func (list *dropDownListData) setDisabledItems(value any) bool {
list.disabledItems = disabledItems
case []DataValue:
disabledItems := make([]string, 0, len(value))
disabledItems := make([]any, 0, len(value))
for _, val := range value {
if !val.IsObject() {
disabledItems = append(disabledItems, val.Value())