mirror of
https://codeberg.org/scip/golsky.git
synced 2025-12-17 12:40:56 +01:00
initial options bug fixed
See
424f62327b
Thanks a lot for the fast support, amazing!
This commit is contained in:
@@ -42,11 +42,17 @@ func NewMenuButton(
|
||||
|
||||
func NewCheckbox(
|
||||
text string,
|
||||
initialvalue bool,
|
||||
action func(args *widget.CheckboxChangedEventArgs)) *widget.LabeledCheckbox {
|
||||
|
||||
checkboxImage, _ := LoadCheckboxImage()
|
||||
buttonImage, _ := LoadButtonImage()
|
||||
|
||||
var state widget.WidgetState
|
||||
if initialvalue {
|
||||
state = widget.WidgetChecked
|
||||
}
|
||||
|
||||
return widget.NewLabeledCheckbox(
|
||||
widget.LabeledCheckboxOpts.CheckboxOpts(
|
||||
widget.CheckboxOpts.ButtonOpts(
|
||||
@@ -54,6 +60,7 @@ func NewCheckbox(
|
||||
),
|
||||
widget.CheckboxOpts.Image(checkboxImage),
|
||||
widget.CheckboxOpts.StateChangedHandler(action),
|
||||
widget.CheckboxOpts.InitialState(state),
|
||||
),
|
||||
widget.LabeledCheckboxOpts.LabelOpts(
|
||||
widget.LabelOpts.Text(text, *FontRenderer.FontSmall,
|
||||
|
||||
Reference in New Issue
Block a user