Documentation
¶
Index ¶
- Variables
- func ListWidgets()
- func MakeDatestamp(t time.Time) string
- func ShowButtons()
- type Node
- func (n *Node) Bool() bool
- func (n *Node) CurrentS() string
- func (n *Node) DumpWidget(pad string)
- func (n *Node) FindWidgetId(id int) *Node
- func (n *Node) GetLabel() string
- func (n *Node) GetProgName() string
- func (n *Node) Hidden() bool
- func (n *Node) InTable() bool
- func (n *Node) IsEnabled() bool
- func (n *Node) Json() []string
- func (n *Node) ListWidgets()
- func (n *Node) ProgName() string
- func (n *Node) SetCurrentS(s string)
- func (n *Node) ShowButtons()
- func (n *Node) String() string
- func (n *Node) Strings() []string
- func (me *Node) VerifyParentId() bool
- type ToolkitConfig
- func (*ToolkitConfig) Descriptor() ([]byte, []int)deprecated
- func (x *ToolkitConfig) GetName() string
- func (x *ToolkitConfig) GetPlugin() string
- func (x *ToolkitConfig) GetValue() string
- func (*ToolkitConfig) ProtoMessage()
- func (x *ToolkitConfig) ProtoReflect() protoreflect.Message
- func (x *ToolkitConfig) Reset()
- func (x *ToolkitConfig) String() string
- type ToolkitConfigScanner
- type ToolkitConfigs
- func (x *ToolkitConfigs) All() *ToolkitConfigScanner
- func (x *ToolkitConfigs) Append(y *ToolkitConfig)
- func (x *ToolkitConfigs) AppendByName(y *ToolkitConfig) bool
- func (x *ToolkitConfigs) AppendByPlugin(y *ToolkitConfig) bool
- func (x *ToolkitConfigs) Clone(y *ToolkitConfig) *ToolkitConfig
- func (x *ToolkitConfigs) CloneByName(y *ToolkitConfig) bool
- func (x *ToolkitConfigs) CloneByPlugin(y *ToolkitConfig) bool
- func (x *ToolkitConfigs) Delete(y *ToolkitConfig) bool
- func (x *ToolkitConfigs) DeleteByName(s string) bool
- func (x *ToolkitConfigs) DeleteByPlugin(s string) bool
- func (*ToolkitConfigs) Descriptor() ([]byte, []int)deprecated
- func (x *ToolkitConfigs) FindByName(s string) *ToolkitConfig
- func (x *ToolkitConfigs) FindByPlugin(s string) *ToolkitConfig
- func (v *ToolkitConfigs) FormatJSON() string
- func (v *ToolkitConfigs) FormatTEXT() string
- func (x *ToolkitConfigs) GetFilename() string
- func (x *ToolkitConfigs) GetToolkitConfigs() []*ToolkitConfig
- func (x *ToolkitConfigs) GetUuid() string
- func (x *ToolkitConfigs) GetVersion() string
- func (x *ToolkitConfigs) InsertByName(y string) *ToolkitConfig
- func (x *ToolkitConfigs) InsertByPlugin(y string) *ToolkitConfig
- func (x *ToolkitConfigs) IterAll() iter.Seq[*ToolkitConfig]
- func (x *ToolkitConfigs) Len() int
- func (pb *ToolkitConfigs) Load() error
- func (v *ToolkitConfigs) Marshal() ([]byte, error)
- func (v *ToolkitConfigs) MarshalJSON() ([]byte, error)
- func (*ToolkitConfigs) ProtoMessage()
- func (x *ToolkitConfigs) ProtoReflect() protoreflect.Message
- func (x *ToolkitConfigs) Reset()
- func (pb *ToolkitConfigs) Save() error
- func (x *ToolkitConfigs) String() string
- func (v *ToolkitConfigs) Unmarshal(data []byte) error
- func (v *ToolkitConfigs) UnmarshalJSON(data []byte) error
- func (v *ToolkitConfigs) UnmarshalTEXT(data []byte) error
- type ToolkitConfigsScanner
- type TreeInfo
- func (me *TreeInfo) AddNode(a *widget.Action) *Node
- func (me *TreeInfo) Callback(guiCallback chan widget.Action)
- func (t *TreeInfo) ConfigFind(n string) (string, error)
- func (t *TreeInfo) ConfigSave(newopt *ToolkitConfig)
- func (me *TreeInfo) DeleteNode(n *Node)
- func (me *TreeInfo) FrozenChannel() chan widget.Action
- func (me *TreeInfo) InitOK()
- func (me *TreeInfo) PluginChannel() chan widget.Action
- func (me *TreeInfo) SendEnableDebugger()
- func (me *TreeInfo) SendFromUser(n *Node)
- func (me *TreeInfo) SendToolkitLoad(s string)
- func (me *TreeInfo) SendToolkitPanic()
- func (me *TreeInfo) SendUserEvent(n *Node)
- func (me *TreeInfo) SendWidgetEvent(n *Node)
- func (me *TreeInfo) SendWindowCloseEvent(n *Node)
- func (me *TreeInfo) WaitOK()
- type TreeTable
Constants ¶
This section is empty.
Variables ¶
var File_toolkitConfig_proto protoreflect.FileDescriptor
var TREE *log.LogFlag
var TREEWARN *log.LogFlag
Functions ¶
func ListWidgets ¶ added in v0.20.2
func ListWidgets()
func MakeDatestamp ¶ added in v0.22.25
TODO; let the user choose the date format
func ShowButtons ¶ added in v0.20.2
func ShowButtons()
Types ¶
type Node ¶
type Node struct {
Parent *Node
WidgetId int // widget ID
WidgetType widget.WidgetType
ParentId int // parent ID
State widget.State
// the internal plugin toolkit structure
// in the gtk plugin, it has gtk things like margin & border settings
// in the text console one, it has text console things like colors for menus & buttons
TK any
// contains filtered or unexported fields
}
func FindWidgetById ¶ added in v0.22.29
func FindWidgetId ¶ added in v0.20.2
searches the binary tree for a WidgetId
func (*Node) DumpWidget ¶
func (*Node) FindWidgetId ¶
searches the binary tree for a WidgetId
func (*Node) GetProgName ¶
func (*Node) ListWidgets ¶
func (n *Node) ListWidgets()
func (*Node) SetCurrentS ¶ added in v0.20.0
func (*Node) ShowButtons ¶
func (n *Node) ShowButtons()
func (*Node) VerifyParentId ¶ added in v0.22.22
used for debugging the 'gui' package to make sure things are valid fixes any errors along the way
type ToolkitConfig ¶ added in v0.22.7
type ToolkitConfig struct {
Plugin string `protobuf:"bytes,1,opt,name=plugin,proto3" json:"plugin,omitempty"` // 'gocui', 'andlabs', etc `autogenpb:unique`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // variable name 'fullscreen' `autogenpb:unique`
Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` // value "true"
// contains filtered or unexported fields
}
func (*ToolkitConfig) Descriptor
deprecated
added in
v0.22.7
func (*ToolkitConfig) Descriptor() ([]byte, []int)
Deprecated: Use ToolkitConfig.ProtoReflect.Descriptor instead.
func (*ToolkitConfig) GetName ¶ added in v0.22.7
func (x *ToolkitConfig) GetName() string
func (*ToolkitConfig) GetPlugin ¶ added in v0.22.7
func (x *ToolkitConfig) GetPlugin() string
func (*ToolkitConfig) GetValue ¶ added in v0.22.7
func (x *ToolkitConfig) GetValue() string
func (*ToolkitConfig) ProtoMessage ¶ added in v0.22.7
func (*ToolkitConfig) ProtoMessage()
func (*ToolkitConfig) ProtoReflect ¶ added in v0.22.7
func (x *ToolkitConfig) ProtoReflect() protoreflect.Message
func (*ToolkitConfig) Reset ¶ added in v0.22.7
func (x *ToolkitConfig) Reset()
func (*ToolkitConfig) String ¶ added in v0.22.7
func (x *ToolkitConfig) String() string
type ToolkitConfigScanner ¶ added in v0.22.36
func (*ToolkitConfigScanner) Next ¶ added in v0.22.36
func (it *ToolkitConfigScanner) Next() *ToolkitConfig
Next() returns the next thing in the array
func (*ToolkitConfigScanner) Scan ¶ added in v0.22.36
func (it *ToolkitConfigScanner) Scan() bool
type ToolkitConfigs ¶ added in v0.22.7
type ToolkitConfigs struct {
Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // `autogenpb:uuid:d7886d47-a3b9-43b9-b0f6-17074a9844e6`
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // `autogenpb:version:v0.0.1`
ToolkitConfigs []*ToolkitConfig `protobuf:"bytes,3,rep,name=ToolkitConfigs,proto3" json:"ToolkitConfigs,omitempty"`
Filename string `protobuf:"bytes,4,opt,name=filename,proto3" json:"filename,omitempty"` // `autogenpb:save` -- this enables autogenerated pb.Load() and pb.Save()
// contains filtered or unexported fields
}
func NewToolkitConfigs ¶ added in v0.22.7
func NewToolkitConfigs() *ToolkitConfigs
func (*ToolkitConfigs) All ¶ added in v0.22.7
func (x *ToolkitConfigs) All() *ToolkitConfigScanner
func (*ToolkitConfigs) Append ¶ added in v0.22.7
func (x *ToolkitConfigs) Append(y *ToolkitConfig)
a Append() shortcut (that does Clone() with a mutex) notsure if it really works doesn't allow nil
func (*ToolkitConfigs) AppendByName ¶ added in v0.22.36
func (x *ToolkitConfigs) AppendByName(y *ToolkitConfig) bool
func (*ToolkitConfigs) AppendByPlugin ¶ added in v0.22.36
func (x *ToolkitConfigs) AppendByPlugin(y *ToolkitConfig) bool
func (*ToolkitConfigs) Clone ¶ added in v0.22.43
func (x *ToolkitConfigs) Clone(y *ToolkitConfig) *ToolkitConfig
a Clone() shortcut (with a mutex). notsure if it really works
func (*ToolkitConfigs) CloneByName ¶ added in v0.22.43
func (x *ToolkitConfigs) CloneByName(y *ToolkitConfig) bool
func (*ToolkitConfigs) CloneByPlugin ¶ added in v0.22.43
func (x *ToolkitConfigs) CloneByPlugin(y *ToolkitConfig) bool
func (*ToolkitConfigs) Delete ¶ added in v0.22.7
func (x *ToolkitConfigs) Delete(y *ToolkitConfig) bool
func (*ToolkitConfigs) DeleteByName ¶ added in v0.22.36
func (x *ToolkitConfigs) DeleteByName(s string) bool
func (*ToolkitConfigs) DeleteByPlugin ¶ added in v0.22.36
func (x *ToolkitConfigs) DeleteByPlugin(s string) bool
func (*ToolkitConfigs) Descriptor
deprecated
added in
v0.22.7
func (*ToolkitConfigs) Descriptor() ([]byte, []int)
Deprecated: Use ToolkitConfigs.ProtoReflect.Descriptor instead.
func (*ToolkitConfigs) FindByName ¶ added in v0.22.36
func (x *ToolkitConfigs) FindByName(s string) *ToolkitConfig
lookup a ToolkitConfigs by the Name
func (*ToolkitConfigs) FindByPlugin ¶ added in v0.22.36
func (x *ToolkitConfigs) FindByPlugin(s string) *ToolkitConfig
lookup a ToolkitConfigs by the Plugin
func (*ToolkitConfigs) FormatJSON ¶ added in v0.22.7
func (v *ToolkitConfigs) FormatJSON() string
human readable JSON
func (*ToolkitConfigs) FormatTEXT ¶ added in v0.22.7
func (v *ToolkitConfigs) FormatTEXT() string
apparently this isn't stable, but it's awesomely better https://protobuf.dev/reference/go/faq/#unstable-text it's brilliant for config files!
func (*ToolkitConfigs) GetFilename ¶ added in v0.22.47
func (x *ToolkitConfigs) GetFilename() string
func (*ToolkitConfigs) GetToolkitConfigs ¶ added in v0.22.7
func (x *ToolkitConfigs) GetToolkitConfigs() []*ToolkitConfig
func (*ToolkitConfigs) GetUuid ¶ added in v0.22.7
func (x *ToolkitConfigs) GetUuid() string
func (*ToolkitConfigs) GetVersion ¶ added in v0.22.7
func (x *ToolkitConfigs) GetVersion() string
func (*ToolkitConfigs) InsertByName ¶ added in v0.22.36
func (x *ToolkitConfigs) InsertByName(y string) *ToolkitConfig
returns a ToolkitConfig if Name matches, otherwise create
func (*ToolkitConfigs) InsertByPlugin ¶ added in v0.22.36
func (x *ToolkitConfigs) InsertByPlugin(y string) *ToolkitConfig
returns a ToolkitConfig if Plugin matches, otherwise create
func (*ToolkitConfigs) IterAll ¶ added in v0.22.26
func (x *ToolkitConfigs) IterAll() iter.Seq[*ToolkitConfig]
Iterate 'for x := range' syntax using the awesome golang 1.24 'iter'
func (*ToolkitConfigs) Len ¶ added in v0.22.7
func (x *ToolkitConfigs) Len() int
func (*ToolkitConfigs) Load ¶ added in v0.22.47
func (pb *ToolkitConfigs) Load() error
func (*ToolkitConfigs) Marshal ¶ added in v0.22.7
func (v *ToolkitConfigs) Marshal() ([]byte, error)
marshal to wire. This is called winning.
func (*ToolkitConfigs) MarshalJSON ¶ added in v0.22.7
func (v *ToolkitConfigs) MarshalJSON() ([]byte, error)
marshal json
func (*ToolkitConfigs) ProtoMessage ¶ added in v0.22.7
func (*ToolkitConfigs) ProtoMessage()
func (*ToolkitConfigs) ProtoReflect ¶ added in v0.22.7
func (x *ToolkitConfigs) ProtoReflect() protoreflect.Message
func (*ToolkitConfigs) Reset ¶ added in v0.22.7
func (x *ToolkitConfigs) Reset()
func (*ToolkitConfigs) Save ¶ added in v0.22.47
func (pb *ToolkitConfigs) Save() error
func (*ToolkitConfigs) String ¶ added in v0.22.7
func (x *ToolkitConfigs) String() string
func (*ToolkitConfigs) Unmarshal ¶ added in v0.22.7
func (v *ToolkitConfigs) Unmarshal(data []byte) error
unmarshal from wire. You have won.
func (*ToolkitConfigs) UnmarshalJSON ¶ added in v0.22.7
func (v *ToolkitConfigs) UnmarshalJSON(data []byte) error
unmarshal json
func (*ToolkitConfigs) UnmarshalTEXT ¶ added in v0.22.7
func (v *ToolkitConfigs) UnmarshalTEXT(data []byte) error
unmarshalTEXT. This reads the .text config file back in after the user edits it
type ToolkitConfigsScanner ¶ added in v0.22.36
func (*ToolkitConfigsScanner) Next ¶ added in v0.22.36
func (it *ToolkitConfigsScanner) Next() *ToolkitConfigs
Next() returns the next thing in the array
func (*ToolkitConfigsScanner) Scan ¶ added in v0.22.36
func (it *ToolkitConfigsScanner) Scan() bool
type TreeInfo ¶
type TreeInfo struct {
sync.Mutex // a lock around the tree to serialize access
PluginName string // used to identify the plugin
Add func(*Node) // add a new widget
AddText func(*Node, string) // add a string to a dropdown widget
SetText func(*Node, string) // set the text of a widget
SetTitle func(*Node, string) // update the title of a window or tab
SetLabel func(*Node, string) // update the "label" (aka "Name") for a widget
SetChecked func(*Node, bool) // set the state of a checkbox
ToolkitInit func() // init the plugin
ToolkitClose func() // shutdown and unload the plugin
Show func(*Node) // show a widget
Hide func(*Node) // hide a widget
Enable func(*Node) // enable a widget
Disable func(*Node) // disable a widget
ShowTable func(*guipb.Table) // attempt at sending a whole table
// contains filtered or unexported fields
}
func (*TreeInfo) Callback ¶
Other goroutines must use this to access the GUI
You can not acess / process the GUI thread directly from other goroutines. This is due to the nature of how Linux, MacOS and Windows work (they all work differently. suprise. surprise.)
this sets the channel to send user events back from the plugin
func (*TreeInfo) ConfigFind ¶ added in v0.22.7
func (*TreeInfo) ConfigSave ¶ added in v0.22.29
func (t *TreeInfo) ConfigSave(newopt *ToolkitConfig)
func (*TreeInfo) DeleteNode ¶ added in v0.22.22
func (*TreeInfo) FrozenChannel ¶ added in v0.22.20
this is the function that receives things from the application
func (*TreeInfo) PluginChannel ¶
this is the function that receives things from the application
func (*TreeInfo) SendEnableDebugger ¶
func (me *TreeInfo) SendEnableDebugger()
func (*TreeInfo) SendFromUser ¶ added in v0.19.2
func (*TreeInfo) SendToolkitLoad ¶
func (*TreeInfo) SendToolkitPanic ¶
func (me *TreeInfo) SendToolkitPanic()
func (*TreeInfo) SendUserEvent ¶
Other goroutines must use this to access the GUI
func (*TreeInfo) SendWidgetEvent ¶ added in v0.19.2
The user clicked on something. Or typed something