binding.Bool
import "fyne.io/fyne/v2/data/binding"Usage
type Bool
type Bool = Item[bool]Bool supports binding a bool value.
2.0func And
func And(data ...Bool) BoolAnd returns a Bool binding that return true when all the passed Bool binding are true and false otherwise. It does apply a logical and boolean operation on all passed Bool bindings. This binding is two way. In case of a Set, it will propagate the value identically to all the Bool bindings used for its construction.
Since 2.4
func BindPreferenceBool
func BindPreferenceBool(key string, p fyne.Preferences) BoolBindPreferenceBool returns a bindable bool value that is managed by the application preferences. Changes to this value will be saved to application storage and when the app starts the previous values will be read.
2.0func NewBool
func NewBool() BoolNewBool returns a bindable bool value that is managed internally.
2.0func Not
func Not(data Bool) BoolNot returns a Bool binding that invert the value of the given data binding. This is providing the logical Not boolean operation as a data binding.
Since 2.4
func Or
func Or(data ...Bool) BoolOr returns a Bool binding that return true when at least one of the passed Bool binding is true and false otherwise. It does apply a logical or boolean operation on all passed Bool bindings. This binding is two way. In case of a Set, it will propagate the value identically to all the Bool bindings used for its construction.
Since 2.4
func StringToBool
func StringToBool(str String) BoolStringToBool creates a binding that connects a String data item to a Bool. Changes to the String will be parsed and pushed to the Bool if the parse was successful, and setting the Bool update the String binding.
2.0func StringToBoolWithFormat
func StringToBoolWithFormat(str String, format string) BoolStringToBoolWithFormat creates a binding that connects a String data item to a Bool and is presented using the specified format. Changes to the Bool will be parsed and if the format matches and the parse is successful it will be pushed to the String. Setting the Bool will push a formatted value into the String.
2.0