From 88fbc620e597108759c9929d263d57c4b7ee6b0b Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 15 Jan 2024 15:17:51 -0600 Subject: initial repo --- settings.go | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 settings.go (limited to 'settings.go') 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 +} -- cgit v1.2.3