// Table is a Control that displays a list of like-structured data in a grid where each row represents an item and each column represents a bit of data.
// As such, a Table renders a []struct{...} where each field of the struct can be a string, a number, [TODO an image, or a checkbox].
// Tables maintain their own storage behind a sync.RWMutex-compatible sync.Locker; use Table.Lock()/Table.Unlock() to make changes and Table.RLock()/Table.RUnlock() to merely read values.
// The returned value will contain an object of type pointer to slice of some structure; use a type assertion to get the properly typed object out.
// Do not call this outside a Lock()..Unlock() or RLock()..RUnlock() pair.
Data()interface{}
}
typetablebasestruct{
locksync.RWMutex
datainterface{}
}
// NewTable creates a new Table.
// Currently, the argument must be a reflect.Type representing the structure that each item in the Table will hold, and the Table will be initially empty.
// This will change in the future.
funcNewTable(tyreflect.Type)Table{
ifty.Kind()!=reflect.Struct{
panic(fmt.Errorf("unknown or unsupported type %v given to NewTable()",ty))