IDFromBits#
func IDFromBits(bits uint64) IDIDFromBits is the inverse of Bits.
type ID struct {
// contains filtered or unexported fields
}ID identifies a pointer interaction region: a scope and a name. The zero ID means "no target". IDs compare with ==.
IDFromBits#func IDFromBits(bits uint64) IDIDFromBits is the inverse of Bits.
Item#func Item(n int) IDItem returns the identity of item n in the anonymous scope: for examples, previews and tests that need a few identities and no tree of their own. Item(0) is the zero ID, "no target", so a number kept in a plain field can say so. An application with more than a screenful of controls names them in a Tree.
Bits#func (id ID) Bits() uint64Bits packs the identity into 64 bits, for carrying it between processes (the development reload worker and its window). The number means something only to the Tree that made it; the process that receives it may compare it and send it back, and nothing else.
In#func (id ID) In(list Scope) (int, bool)In returns the item number of an identity that is item i of the list scope, and false for any other identity: the way a handler reads which row was clicked.
if row, ok := id.In(rows); ok { open(row) }IsZero#func (id ID) IsZero() boolIsZero reports whether the ID is "no target".
Name#func (id ID) Name() NameName returns the ID's name within its scope: for an item of a list, its number.
Scope#func (id ID) Scope() ScopeScope returns the place the ID is in.