diff options
| author | Jeff Carr <[email protected]> | 2024-01-15 15:17:51 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-15 15:17:51 -0600 |
| commit | 88fbc620e597108759c9929d263d57c4b7ee6b0b (patch) | |
| tree | 84eed9c295bf8387f8ce1d018ab719081c4c65f7 /settings.go | |
initial repo
Diffstat (limited to 'settings.go')
| -rw-r--r-- | settings.go | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/settings.go b/settings.go new file mode 100644 index 0000000..2bc252a --- /dev/null +++ b/settings.go @@ -0,0 +1,43 @@ +package logsettings + +import ( + "go.wit.com/log" + "go.wit.com/gui/gui" +) + +// This initializes the main object +// You can only have one of these +func New(p *gui.Node) *LogSettings { + if myLogGui != nil {return myLogGui} + myLogGui = new(LogSettings) + myLogGui.parent = p + myLogGui.groups = make(map[string]*flagGroup) + myLogGui.ready = true + myLogGui.hidden = true + return myLogGui +} + +// Returns true if the status is valid +func (d *LogSettings) Ready() bool { + if d == nil {return false} + if ! d.parent.Ready() {return false} + if (d.win == nil) { + d.draw() + } + return d.ready +} + +func (d *LogSettings) Update() bool { + if ! d.Ready() {return false} + return true +} + +func (d *LogSettings) ShowFlags() { + log.ShowFlags() + return +} + +func (d *LogSettings) SetAll(b bool) { + log.SetAll(b) + return +} |
