Documentation
¶
Overview ¶
Package binding provides support for binding data to widgets. All APIs in the binding package are safe to invoke directly from any goroutine.
Index ¶
- Constants
- type Bool
- type BoolList
- type BoolTree
- type Bytes
- type BytesList
- type BytesTree
- type DataItem
- type DataList
- type DataListener
- type DataMap
- type DataTree
- type ExternalBool
- type ExternalBoolList
- type ExternalBoolTree
- type ExternalBytes
- type ExternalBytesList
- type ExternalBytesTree
- type ExternalFloat
- type ExternalFloatList
- type ExternalFloatTree
- type ExternalInt
- type ExternalIntList
- type ExternalIntTree
- type ExternalItem
- type ExternalList
- func BindBoolList(v *[]bool) ExternalList[bool]
- func BindBytesList(v *[][]byte) ExternalList[[]byte]
- func BindFloatList(v *[]float64) ExternalList[float64]
- func BindIntList(v *[]int) ExternalList[int]
- func BindList[T any](v *[]T, comparator func(T, T) bool) ExternalList[T]
- func BindRuneList(v *[]rune) ExternalList[rune]
- func BindStringList(v *[]string) ExternalList[string]
- func BindURIList(v *[]fyne.URI) ExternalList[fyne.URI]
- func BindUntypedList(v *[]any) ExternalList[any]
- type ExternalRune
- type ExternalRuneList
- type ExternalRuneTree
- type ExternalString
- type ExternalStringList
- type ExternalStringTree
- type ExternalTree
- func BindBoolTree(ids *map[string][]string, v *map[string]bool) ExternalTree[bool]
- func BindBytesTree(ids *map[string][]string, v *map[string][]byte) ExternalTree[[]byte]
- func BindFloatTree(ids *map[string][]string, v *map[string]float64) ExternalTree[float64]
- func BindIntTree(ids *map[string][]string, v *map[string]int) ExternalTree[int]
- func BindRuneTree(ids *map[string][]string, v *map[string]rune) ExternalTree[rune]
- func BindStringTree(ids *map[string][]string, v *map[string]string) ExternalTree[string]
- func BindTree[T any](ids *map[string][]string, v *map[string]T, comparator func(T, T) bool) ExternalTree[T]
- func BindURITree(ids *map[string][]string, v *map[string]fyne.URI) ExternalTree[fyne.URI]
- func BindUntypedTree(ids *map[string][]string, v *map[string]any) ExternalTree[any]
- type ExternalURI
- type ExternalURIList
- type ExternalURITree
- type ExternalUntyped
- type ExternalUntypedList
- type ExternalUntypedMap
- type ExternalUntypedTree
- type Float
- type FloatList
- type FloatTree
- type Int
- type IntList
- type IntTree
- type Item
- type List
- func NewBoolList() List[bool]
- func NewBytesList() List[[]byte]
- func NewFloatList() List[float64]
- func NewIntList() List[int]
- func NewList[T any](comparator func(T, T) bool) List[T]
- func NewRuneList() List[rune]
- func NewStringList() List[string]
- func NewURIList() List[fyne.URI]
- func NewUntypedList() List[any]
- type Rune
- type RuneList
- type RuneTree
- type String
- func BindPreferenceString(key string, p fyne.Preferences) String
- func BoolToString(v Bool) String
- func BoolToStringWithFormat(v Bool, format string) String
- func FloatToString(v Float) String
- func FloatToStringWithFormat(v Float, format string) String
- func IntToString(v Int) String
- func IntToStringWithFormat(v Int, format string) String
- func NewSprintf(format string, b ...DataItem) String
- func NewString() String
- func StringToStringWithFormat(str String, format string) String
- func URIToString(v URI) String
- type StringList
- type StringTree
- type Struct
- type Tree
- func NewBoolTree() Tree[bool]
- func NewBytesTree() Tree[[]byte]
- func NewFloatTree() Tree[float64]
- func NewIntTree() Tree[int]
- func NewRuneTree() Tree[rune]
- func NewStringTree() Tree[string]
- func NewTree[T any](comparator func(T, T) bool) Tree[T]
- func NewURITree() Tree[fyne.URI]
- func NewUntypedTree() Tree[any]
- type URI
- type URIList
- type URITree
- type Untyped
- type UntypedList
- type UntypedMap
- type UntypedTree
Constants ¶
const DataTreeRootID = ""
DataTreeRootID const is the value used as ID for the root of any tree binding.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bool ¶
Bool supports binding a bool value.
Since: 2.0
func And ¶ added in v2.4.0
And 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 ¶
BindPreferenceBool 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.
Since: 2.0
func NewBool ¶
func NewBool() Bool
NewBool returns a bindable bool value that is managed internally.
Since: 2.0
func Not ¶ added in v2.4.0
Not 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 ¶ added in v2.4.0
Or 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 ¶
StringToBool 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.
Since: 2.0
func StringToBoolWithFormat ¶
StringToBoolWithFormat 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.
Since: 2.0
type BoolList ¶
BoolList supports binding a list of bool values.
Since: 2.0
func BindPreferenceBoolList ¶ added in v2.6.0
BindPreferenceBoolList returns a bound list of bool values 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.
Since: 2.6
type DataItem ¶
type DataItem interface { // AddListener attaches a new change listener to this DataItem. // Listeners are called each time the data inside this DataItem changes. // Additionally, the listener will be triggered upon successful connection to get the current value. AddListener(DataListener) // RemoveListener will detach the specified change listener from the DataItem. // Disconnected listener will no longer be triggered when changes occur. RemoveListener(DataListener) }
DataItem is the base interface for all bindable data items. All APIs on bindable data items are safe to invoke directly fron any goroutine.
Since: 2.0
type DataListener ¶
type DataListener interface {
DataChanged()
}
DataListener is any object that can register for changes in a bindable DataItem. See NewDataListener to define a new listener using just an inline function.
Since: 2.0
func NewDataListener ¶
func NewDataListener(fn func()) DataListener
NewDataListener is a helper function that creates a new listener type from a simple callback function.
Since: 2.0
type DataTree ¶ added in v2.4.0
DataTree is the base interface for all bindable data trees.
Since: 2.4
type ExternalBool ¶
type ExternalBool = ExternalItem[bool]
ExternalBool supports binding a bool value to an external value.
Since: 2.0
func BindBool ¶
func BindBool(v *bool) ExternalBool
BindBool returns a new bindable value that controls the contents of the provided bool variable. If your code changes the content of the variable this refers to you should call Reload() to inform the bindings.
Since: 2.0
type ExternalBoolList ¶
type ExternalBoolList = ExternalList[bool]
ExternalBoolList supports binding a list of bool values from an external variable.
Since: 2.0
type ExternalBoolTree ¶ added in v2.4.0
type ExternalBoolTree = ExternalTree[bool]
ExternalBoolTree supports binding a tree of bool values from an external variable.
Since: 2.4
type ExternalBytes ¶ added in v2.2.0
type ExternalBytes = ExternalItem[[]byte]
ExternalBytes supports binding a []byte value to an external value.
Since: 2.2
func BindBytes ¶ added in v2.2.0
func BindBytes(v *[]byte) ExternalBytes
BindBytes returns a new bindable value that controls the contents of the provided []byte variable. If your code changes the content of the variable this refers to you should call Reload() to inform the bindings.
Since: 2.2
type ExternalBytesList ¶ added in v2.2.0
type ExternalBytesList = ExternalList[[]byte]
ExternalBytesList supports binding a list of []byte values from an external variable.
Since: 2.2
type ExternalBytesTree ¶ added in v2.4.0
type ExternalBytesTree = ExternalTree[[]byte]
ExternalBytesTree supports binding a tree of []byte values from an external variable.
Since: 2.4
type ExternalFloat ¶
type ExternalFloat = ExternalItem[float64]
ExternalFloat supports binding a float64 value to an external value.
Since: 2.0
func BindFloat ¶
func BindFloat(v *float64) ExternalFloat
BindFloat returns a new bindable value that controls the contents of the provided float64 variable. If your code changes the content of the variable this refers to you should call Reload() to inform the bindings.
Since: 2.0
type ExternalFloatList ¶
type ExternalFloatList = ExternalList[float64]
ExternalFloatList supports binding a list of float64 values from an external variable.
Since: 2.0
type ExternalFloatTree ¶ added in v2.4.0
type ExternalFloatTree = ExternalTree[float64]
ExternalFloatTree supports binding a tree of float64 values from an external variable.
Since: 2.4
type ExternalInt ¶
type ExternalInt = ExternalItem[int]
ExternalInt supports binding a int value to an external value.
Since: 2.0
func BindInt ¶
func BindInt(v *int) ExternalInt
BindInt returns a new bindable value that controls the contents of the provided int variable. If your code changes the content of the variable this refers to you should call Reload() to inform the bindings.
Since: 2.0
type ExternalIntList ¶
type ExternalIntList = ExternalList[int]
ExternalIntList supports binding a list of int values from an external variable.
Since: 2.0
type ExternalIntTree ¶ added in v2.4.0
type ExternalIntTree = ExternalTree[int]
ExternalIntTree supports binding a tree of int values from an external variable.
Since: 2.4
type ExternalItem ¶ added in v2.6.0
ExternalItem supports binding any external value of type T.
Since: 2.6
func BindItem ¶ added in v2.6.0
func BindItem[T any](val *T, comparator func(T, T) bool) ExternalItem[T]
BindItem returns a new bindable value that controls the contents of the provided variable of type T. If your code changes the content of the variable this refers to you should call Reload() to inform the bindings.
Since: 2.6
type ExternalList ¶ added in v2.7.0
ExternalList supports binding a list of values, with type T, from an external variable.
Since: 2.7
func BindBoolList ¶
func BindBoolList(v *[]bool) ExternalList[bool]
BindBoolList returns a bound list of bool values, based on the contents of the passed slice. If your code changes the content of the slice this refers to you should call Reload() to inform the bindings.
Since: 2.0
func BindBytesList ¶ added in v2.2.0
func BindBytesList(v *[][]byte) ExternalList[[]byte]
BindBytesList returns a bound list of []byte values, based on the contents of the passed slice. If your code changes the content of the slice this refers to you should call Reload() to inform the bindings.
Since: 2.2
func BindFloatList ¶
func BindFloatList(v *[]float64) ExternalList[float64]
BindFloatList returns a bound list of float64 values, based on the contents of the passed slice. If your code changes the content of the slice this refers to you should call Reload() to inform the bindings.
Since: 2.0
func BindIntList ¶
func BindIntList(v *[]int) ExternalList[int]
BindIntList returns a bound list of int values, based on the contents of the passed slice. If your code changes the content of the slice this refers to you should call Reload() to inform the bindings.
Since: 2.0
func BindList ¶ added in v2.7.0
func BindList[T any](v *[]T, comparator func(T, T) bool) ExternalList[T]
BindList returns a bound list of values with type T, based on the contents of the passed slice. If your code changes the content of the slice this refers to you should call Reload() to inform the bindings.
Since: 2.7
func BindRuneList ¶
func BindRuneList(v *[]rune) ExternalList[rune]
BindRuneList returns a bound list of rune values, based on the contents of the passed slice. If your code changes the content of the slice this refers to you should call Reload() to inform the bindings.
Since: 2.0
func BindStringList ¶
func BindStringList(v *[]string) ExternalList[string]
BindStringList returns a bound list of string values, based on the contents of the passed slice. If your code changes the content of the slice this refers to you should call Reload() to inform the bindings.
Since: 2.0
func BindURIList ¶ added in v2.1.0
func BindURIList(v *[]fyne.URI) ExternalList[fyne.URI]
BindURIList returns a bound list of fyne.URI values, based on the contents of the passed slice. If your code changes the content of the slice this refers to you should call Reload() to inform the bindings.
Since: 2.1
func BindUntypedList ¶ added in v2.1.0
func BindUntypedList(v *[]any) ExternalList[any]
BindUntypedList returns a bound list of any values, based on the contents of the passed slice. If your code changes the content of the slice this refers to you should call Reload() to inform the bindings.
Since: 2.1
type ExternalRune ¶
type ExternalRune = ExternalItem[rune]
ExternalRune supports binding a rune value to an external value.
Since: 2.0
func BindRune ¶
func BindRune(v *rune) ExternalRune
BindRune returns a new bindable value that controls the contents of the provided rune variable. If your code changes the content of the variable this refers to you should call Reload() to inform the bindings.
Since: 2.0
type ExternalRuneList ¶
type ExternalRuneList = ExternalList[rune]
ExternalRuneList supports binding a list of rune values from an external variable.
Since: 2.0
type ExternalRuneTree ¶ added in v2.4.0
type ExternalRuneTree = ExternalTree[rune]
ExternalRuneTree supports binding a tree of rune values from an external variable.
Since: 2.4
type ExternalString ¶
type ExternalString = ExternalItem[string]
ExternalString supports binding a string value to an external value.
Since: 2.0
func BindString ¶
func BindString(v *string) ExternalString
BindString returns a new bindable value that controls the contents of the provided string variable. If your code changes the content of the variable this refers to you should call Reload() to inform the bindings.
Since: 2.0
type ExternalStringList ¶
type ExternalStringList = ExternalList[string]
ExternalStringList supports binding a list of string values from an external variable.
Since: 2.0
type ExternalStringTree ¶ added in v2.4.0
type ExternalStringTree = ExternalTree[string]
ExternalStringTree supports binding a tree of string values from an external variable.
Since: 2.4
type ExternalTree ¶ added in v2.7.0
ExternalTree supports binding a tree of values, of type T, from an external variable.
Since: 2.7
func BindBoolTree ¶ added in v2.4.0
BindBoolTree returns a bound tree of bool values, based on the contents of the passed values. The ids map specifies how each item relates to its parent (with id ""), with the values being in the v map. If your code changes the content of the maps this refers to you should call Reload() to inform the bindings.
Since: 2.4
func BindBytesTree ¶ added in v2.4.0
BindBytesTree returns a bound tree of []byte values, based on the contents of the passed values. The ids map specifies how each item relates to its parent (with id ""), with the values being in the v map. If your code changes the content of the maps this refers to you should call Reload() to inform the bindings.
Since: 2.4
func BindFloatTree ¶ added in v2.4.0
BindFloatTree returns a bound tree of float64 values, based on the contents of the passed values. The ids map specifies how each item relates to its parent (with id ""), with the values being in the v map. If your code changes the content of the maps this refers to you should call Reload() to inform the bindings.
Since: 2.4
func BindIntTree ¶ added in v2.4.0
BindIntTree returns a bound tree of int values, based on the contents of the passed values. The ids map specifies how each item relates to its parent (with id ""), with the values being in the v map. If your code changes the content of the maps this refers to you should call Reload() to inform the bindings.
Since: 2.4
func BindRuneTree ¶ added in v2.4.0
BindRuneTree returns a bound tree of rune values, based on the contents of the passed values. The ids map specifies how each item relates to its parent (with id ""), with the values being in the v map. If your code changes the content of the maps this refers to you should call Reload() to inform the bindings.
Since: 2.4
func BindStringTree ¶ added in v2.4.0
BindStringTree returns a bound tree of string values, based on the contents of the passed values. The ids map specifies how each item relates to its parent (with id ""), with the values being in the v map. If your code changes the content of the maps this refers to you should call Reload() to inform the bindings.
Since: 2.4
func BindTree ¶ added in v2.7.0
func BindTree[T any](ids *map[string][]string, v *map[string]T, comparator func(T, T) bool) ExternalTree[T]
BindTree returns a bound tree of values with type T, based on the contents of the passed values. The ids map specifies how each item relates to its parent (with id ""), with the values being in the v map. If your code changes the content of the maps this refers to you should call Reload() to inform the bindings.
Since: 2.7
func BindURITree ¶ added in v2.4.0
func BindURITree(ids *map[string][]string, v *map[string]fyne.URI) ExternalTree[fyne.URI]
BindURITree returns a bound tree of fyne.URI values, based on the contents of the passed values. The ids map specifies how each item relates to its parent (with id ""), with the values being in the v map. If your code changes the content of the maps this refers to you should call Reload() to inform the bindings.
Since: 2.4
func BindUntypedTree ¶ added in v2.5.0
BindUntypedTree returns a bound tree of any values, based on the contents of the passed values. The ids map specifies how each item relates to its parent (with id ""), with the values being in the v map. If your code changes the content of the maps this refers to you should call Reload() to inform the bindings.
Since: 2.4
type ExternalURI ¶ added in v2.1.0
type ExternalURI = ExternalItem[fyne.URI]
ExternalURI supports binding a fyne.URI value to an external value.
Since: 2.1
func BindURI ¶ added in v2.1.0
func BindURI(v *fyne.URI) ExternalURI
BindURI returns a new bindable value that controls the contents of the provided fyne.URI variable. If your code changes the content of the variable this refers to you should call Reload() to inform the bindings.
Since: 2.1
type ExternalURIList ¶ added in v2.1.0
type ExternalURIList = ExternalList[fyne.URI]
ExternalURIList supports binding a list of fyne.URI values from an external variable.
Since: 2.1
type ExternalURITree ¶ added in v2.4.0
type ExternalURITree = ExternalTree[fyne.URI]
ExternalURITree supports binding a tree of fyne.URI values from an external variable.
Since: 2.4
type ExternalUntyped ¶ added in v2.1.0
type ExternalUntyped = ExternalItem[any]
ExternalUntyped supports binding a any value to an external value.
Since: 2.1
func BindUntyped ¶ added in v2.1.0
func BindUntyped(v any) ExternalUntyped
BindUntyped returns a bindable any value that is bound to an external type. The parameter must be a pointer to the type you wish to bind.
Since: 2.1
type ExternalUntypedList ¶ added in v2.1.0
type ExternalUntypedList = ExternalList[any]
ExternalUntypedList supports binding a list of any values from an external variable.
Since: 2.1
type ExternalUntypedMap ¶
type ExternalUntypedMap interface { UntypedMap Reload() error }
ExternalUntypedMap is a map data binding with all values untyped (any), connected to an external data source.
Since: 2.0
func BindUntypedMap ¶
func BindUntypedMap(d *map[string]any) ExternalUntypedMap
BindUntypedMap creates a new map binding of string to any based on the data passed. If your code changes the content of the map this refers to you should call Reload() to inform the bindings.
Since: 2.0
type ExternalUntypedTree ¶ added in v2.5.0
type ExternalUntypedTree = ExternalTree[any]
ExternalUntypedTree supports binding a tree of any values from an external variable.
Since: 2.5
type Float ¶
Float supports binding a float64 value.
Since: 2.0
func BindPreferenceFloat ¶
BindPreferenceFloat returns a bindable float64 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.
Since: 2.0
func IntToFloat ¶ added in v2.5.0
IntToFloat creates a binding that connects an Int data item to a Float.
Since: 2.5
func NewFloat ¶
func NewFloat() Float
NewFloat returns a bindable float64 value that is managed internally.
Since: 2.0
func StringToFloat ¶
StringToFloat creates a binding that connects a String data item to a Float. Changes to the String will be parsed and pushed to the Float if the parse was successful, and setting the Float update the String binding.
Since: 2.0
func StringToFloatWithFormat ¶
StringToFloatWithFormat creates a binding that connects a String data item to a Float and is presented using the specified format. Changes to the Float will be parsed and if the format matches and the parse is successful it will be pushed to the String. Setting the Float will push a formatted value into the String.
Since: 2.0
type FloatList ¶
FloatList supports binding a list of float64 values.
Since: 2.0
func BindPreferenceFloatList ¶ added in v2.6.0
BindPreferenceFloatList returns a bound list of float64 values 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.
Since: 2.6
type Int ¶
Int supports binding a int value.
Since: 2.0
func BindPreferenceInt ¶
BindPreferenceInt returns a bindable int 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.
Since: 2.0
func FloatToInt ¶ added in v2.5.0
FloatToInt creates a binding that connects a Float data item to an Int.
Since: 2.5
func NewInt ¶
func NewInt() Int
NewInt returns a bindable int value that is managed internally.
Since: 2.0
func StringToInt ¶
StringToInt creates a binding that connects a String data item to a Int. Changes to the String will be parsed and pushed to the Int if the parse was successful, and setting the Int update the String binding.
Since: 2.0
func StringToIntWithFormat ¶
StringToIntWithFormat creates a binding that connects a String data item to a Int and is presented using the specified format. Changes to the Int will be parsed and if the format matches and the parse is successful it will be pushed to the String. Setting the Int will push a formatted value into the String.
Since: 2.0
type IntList ¶
IntList supports binding a list of int values.
Since: 2.0
func BindPreferenceIntList ¶ added in v2.6.0
BindPreferenceIntList returns a bound list of int values 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.
Since: 2.6
type List ¶ added in v2.7.0
type List[T any] interface { DataList Append(value T) error Get() ([]T, error) GetValue(index int) (T, error) Prepend(value T) error Remove(value T) error Set(list []T) error SetValue(index int, value T) error }
List supports binding a list of values with type T.
Since: 2.7
func NewBytesList ¶ added in v2.2.0
NewBytesList returns a bindable list of []byte values.
Since: 2.2
func NewURIList ¶ added in v2.1.0
func NewURIList() List[fyne.URI]
NewURIList returns a bindable list of fyne.URI values.
Since: 2.1
func NewUntypedList ¶ added in v2.1.0
NewUntypedList returns a bindable list of any values.
Since: 2.1
type String ¶
String supports binding a string value.
Since: 2.0
func BindPreferenceString ¶
BindPreferenceString returns a bindable string 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.
Since: 2.0
func BoolToString ¶
BoolToString creates a binding that connects a Bool data item to a String. Changes to the Bool will be pushed to the String and setting the string will parse and set the Bool if the parse was successful.
Since: 2.0
func BoolToStringWithFormat ¶
BoolToStringWithFormat creates a binding that connects a Bool data item to a String and is presented using the specified format. Changes to the Bool will be pushed to the String and setting the string will parse and set the Bool if the string matches the format and its parse was successful.
Since: 2.0
func FloatToString ¶
FloatToString creates a binding that connects a Float data item to a String. Changes to the Float will be pushed to the String and setting the string will parse and set the Float if the parse was successful.
Since: 2.0
func FloatToStringWithFormat ¶
FloatToStringWithFormat creates a binding that connects a Float data item to a String and is presented using the specified format. Changes to the Float will be pushed to the String and setting the string will parse and set the Float if the string matches the format and its parse was successful.
Since: 2.0
func IntToString ¶
IntToString creates a binding that connects a Int data item to a String. Changes to the Int will be pushed to the String and setting the string will parse and set the Int if the parse was successful.
Since: 2.0
func IntToStringWithFormat ¶
IntToStringWithFormat creates a binding that connects a Int data item to a String and is presented using the specified format. Changes to the Int will be pushed to the String and setting the string will parse and set the Int if the string matches the format and its parse was successful.
Since: 2.0
func NewSprintf ¶ added in v2.2.0
NewSprintf returns a String binding that format its content using the format string and the provide additional parameter that must be other data bindings. This data binding use fmt.Sprintf and fmt.Scanf internally and will have all the same limitation as those function.
Since: 2.2
func NewString ¶
func NewString() String
NewString returns a bindable string value that is managed internally.
Since: 2.0
func StringToStringWithFormat ¶ added in v2.2.0
StringToStringWithFormat creates a binding that converts a string to another string using the specified format. Changes to the returned String will be pushed to the passed in String and setting a new string value will parse and set the underlying String if it matches the format and the parse was successful.
Since: 2.2
func URIToString ¶ added in v2.1.0
URIToString creates a binding that connects a URI data item to a String. Changes to the URI will be pushed to the String and setting the string will parse and set the URI if the parse was successful.
Since: 2.1
type StringList ¶
StringList supports binding a list of string values.
Since: 2.0
func BindPreferenceStringList ¶ added in v2.6.0
func BindPreferenceStringList(key string, p fyne.Preferences) StringList
BindPreferenceStringList returns a bound list of string values 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.
Since: 2.6
type Struct ¶
type Struct interface { DataMap GetValue(string) (any, error) SetValue(string, any) error Reload() error }
Struct is the base interface for a bound struct type.
Since: 2.0
func BindStruct ¶
BindStruct creates a new map binding of string to any using the struct passed as data. The key for each item is a string representation of each exported field with the value set as an any. Only exported fields are included.
Since: 2.0
type Tree ¶ added in v2.7.0
type Tree[T any] interface { DataTree Append(parent, id string, value T) error Get() (map[string][]string, map[string]T, error) GetValue(id string) (T, error) Prepend(parent, id string, value T) error Remove(id string) error Set(ids map[string][]string, values map[string]T) error SetValue(id string, value T) error }
Tree supports binding a tree of values with type T.
Since: 2.7
func NewBytesTree ¶ added in v2.4.0
NewBytesTree returns a bindable tree of []byte values.
Since: 2.4
func NewFloatTree ¶ added in v2.4.0
NewFloatTree returns a bindable tree of float64 values.
Since: 2.4
func NewStringTree ¶ added in v2.4.0
NewStringTree returns a bindable tree of string values.
Since: 2.4
func NewURITree ¶ added in v2.4.0
func NewURITree() Tree[fyne.URI]
NewURITree returns a bindable tree of fyne.URI values.
Since: 2.4
func NewUntypedTree ¶ added in v2.5.0
NewUntypedTree returns a bindable tree of any values.
Since: 2.5
type URI ¶ added in v2.1.0
type URI = Item[fyne.URI]
URI supports binding a fyne.URI value.
Since: 2.1
func NewURI ¶ added in v2.1.0
func NewURI() URI
NewURI returns a bindable fyne.URI value that is managed internally.
Since: 2.1
func StringToURI ¶ added in v2.1.0
StringToURI creates a binding that connects a String data item to a URI. Changes to the String will be parsed and pushed to the URI if the parse was successful, and setting the URI update the String binding.
Since: 2.1
type URIList ¶ added in v2.1.0
type URIList = List[fyne.URI]
URIList supports binding a list of fyne.URI values.
Since: 2.1
type URITree ¶ added in v2.4.0
type URITree = Tree[fyne.URI]
URITree supports binding a tree of fyne.URI values.
Since: 2.4
type Untyped ¶
Untyped supports binding an any value.
Since: 2.1
func NewUntyped ¶ added in v2.1.0
func NewUntyped() Untyped
NewUntyped returns a bindable any value that is managed internally.
Since: 2.1
type UntypedMap ¶
type UntypedMap interface { DataMap Delete(string) Get() (map[string]any, error) GetValue(string) (any, error) Set(map[string]any) error SetValue(string, any) error }
UntypedMap is a map data binding with all values Untyped (any).
Since: 2.0
func NewUntypedMap ¶
func NewUntypedMap() UntypedMap
NewUntypedMap creates a new, empty map binding of string to any.
Since: 2.0