Compare commits

...

14 Commits

Author SHA1 Message Date
Jeff Carr d2315ff857 update go mod
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-06 18:00:13 -06:00
Jeff Carr 4ed50c9747 support Make()/Draw() state
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-06 13:54:06 -06:00
Jeff Carr 30832551c3 use log Flags
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-05 20:29:57 -06:00
Jeff Carr 85cbd78883 first gadget with a 'state' concept
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-05 16:11:38 -06:00
Jeff Carr 05eb9b5ad8 BasicWindow Ready() and Title()
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-05 12:24:29 -06:00
Jeff Carr d69a41a295 switch log to BasicWindow()
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-04 22:02:12 -06:00
Jeff Carr 54b576b69d output changes
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-04 16:29:41 -06:00
Jeff Carr 32876a5bfb restore defaults, all on, all off all work
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-04 15:14:37 -06:00
Jeff Carr 10001c7006 subsystem flags are displayed
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-04 14:41:37 -06:00
Jeff Carr 1e83c1e609 logsettings window works
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-04 12:47:36 -06:00
Jeff Carr 51929bdde2 working log window
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-04 12:23:36 -06:00
Jeff Carr 57b8fdc060 mod update
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-03 20:53:01 -06:00
Jeff Carr ea68f9b73c new gui version
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-01 17:42:35 -06:00
Jeff Carr 0134614548 github push rules
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-01 17:37:08 -06:00
17 changed files with 469 additions and 108 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*.swp
# ignore compiled plugins
*.so

22
Makefile Normal file
View File

@ -0,0 +1,22 @@
#a git remote add github git@github.com:wit-go/gadgets.git
all:
@echo
@echo gadgets are collections of widget primaties that work
@echo in ways that are common enough they are generally useful
@echo
@echo The gadgets are themselves outside of the 'gui' binary tree
@echo structure. They do not modify the fundamental nature of
@echo how the 'gui' package communicates to the toolkits via the plugin
@echo
@echo in that sense, they are intended to be useful wrappers
@echo
redomod:
rm -f go.*
go mod init
go mod tidy
github:
git push -u github master
git push -u github devel
git push github --tags

18
args.go Normal file
View File

@ -0,0 +1,18 @@
package gadgets
// initializes logging and command line options
import (
"go.wit.com/log"
)
var INFO log.LogFlag
func init() {
INFO.B = false
INFO.Name = "INFO"
INFO.Subsystem = "gadgets"
INFO.Short = "gadgets"
INFO.Desc = "general info"
INFO.Register()
}

View File

@ -43,14 +43,14 @@ func (d *BasicCombobox) Ready() bool {
func (d *BasicCombobox) Add(value string) {
if ! d.Ready() {return}
log.Println("BasicCombobox.Add() =", value)
log.Log(INFO, "BasicCombobox.Add() =", value)
d.d.AddDropdownName(value)
return
}
func (d *BasicCombobox) Set(value string) bool {
if ! d.Ready() {return false}
log.Println("BasicCombobox.Set() =", value)
log.Log(INFO, "BasicCombobox.Set() =", value)
d.d.SetText(value)
d.value = value
return true
@ -68,7 +68,7 @@ func NewBasicCombobox(p *gui.Node, name string) *BasicCombobox {
d.d = p.NewCombobox("")
d.d.Custom = func() {
d.value = d.Get()
log.Println("BasicCombobox.Custom() user changed value to =", d.value)
log.Log(INFO, "BasicCombobox.Custom() user changed value to =", d.value)
if d.Custom != nil {
d.Custom()
}

View File

@ -43,14 +43,14 @@ func (d *BasicDropdown) Ready() bool {
func (d *BasicDropdown) Add(value string) {
if ! d.Ready() {return}
log.Println("BasicDropdown.Set() =", value)
log.Log(INFO, "BasicDropdown.Set() =", value)
d.d.AddDropdownName(value)
return
}
func (d *BasicDropdown) Set(value string) bool {
if ! d.Ready() {return false}
log.Println("BasicDropdown.Set() =", value)
log.Log(INFO, "BasicDropdown.Set() =", value)
d.l.SetText(value)
d.value = value
return true
@ -68,7 +68,7 @@ func NewBasicDropdown(p *gui.Node, name string) *BasicDropdown {
d.d = p.NewDropdown("")
d.d.Custom = func() {
d.value = d.Get()
log.Println("BasicDropdown.Custom() user changed value to =", d.value)
log.Log(INFO, "BasicDropdown.Custom() user changed value to =", d.value)
if d.Custom != nil {
d.Custom()
}

View File

@ -30,7 +30,7 @@ func (n *BasicEntry) Get() string {
}
func (n *BasicEntry) Set(value string) *BasicEntry {
log.Println("BasicEntry.Set() =", value)
log.Log(INFO, "BasicEntry.Set() =", value)
if (n.v != nil) {
n.v.Set(value)
}
@ -49,7 +49,7 @@ func NewBasicEntry(p *gui.Node, name string) *BasicEntry {
d.v = p.NewEntryLine("")
d.v.Custom = func() {
d.value = d.v.S
log.Println("BasicEntry.Custom() user changed value to =", d.value)
log.Log(INFO, "BasicEntry.Custom() user changed value to =", d.value)
}
return &d

View File

@ -32,7 +32,7 @@ func (n *BasicLabel) Get() string {
}
func (n *BasicLabel) Set(value string) *BasicLabel {
log.Println("BasicLabel.Set() =", value)
log.Log(INFO, "BasicLabel.Set() =", value)
if (n.v != nil) {
n.v.Set(value)
}
@ -53,7 +53,7 @@ func (ngui *Node) NewBasicLabel(name string) *BasicLabel {
d.v = n.NewLabel("")
d.v.Custom = func() {
d.value = d.v.S
log.Println("BasicLabel.Custom() user changed value to =", d.value)
log.Log(INFO, "BasicLabel.Custom() user changed value to =", d.value)
}
return &d

138
basicWindow.go Normal file
View File

@ -0,0 +1,138 @@
/*
A Standard Window
*/
package gadgets
import (
"go.wit.com/log"
"go.wit.com/gui/gui"
)
type BasicWindow struct {
ready bool
hidden bool
vertical bool
name string
parent *gui.Node
win *gui.Node // window widget
box *gui.Node // box
Custom func()
}
func (w *BasicWindow) Hide() {
if ! w.Ready() {return}
w.win.Hide()
w.hidden = true
return
}
func (w *BasicWindow) Show() {
if ! w.Ready() {return}
w.win.Show()
w.hidden = false
return
}
func (w *BasicWindow) Toggle() {
if ! w.Ready() {return}
if w.hidden {
w.Show()
w.hidden = false
} else {
w.Hide()
w.hidden = true
}
return
}
func (w *BasicWindow) Title(title string) {
if ! w.Ready() {return}
w.win.SetText(title)
return
}
// Returns true if initialized
func (w *BasicWindow) Initialized() bool {
if w == nil {return false}
if w.parent == nil {return false}
return true
}
// Returns true if the status is valid
func (w *BasicWindow) Ready() bool {
if ! w.Initialized() {return false}
if ! w.parent.Ready() {return false}
return w.ready
}
func (w *BasicWindow) Box() *gui.Node {
if ! w.Initialized() {return nil}
if (w.win == nil) {
w.Draw()
}
return w.box
}
func (w *BasicWindow) Vertical() {
log.Log(INFO, "BasicWindow() w.vertical =", w.vertical)
if ! w.Initialized() {
log.Warn("BasicWindow() not Initialized yet()")
return
}
if w.Ready() {
log.Warn("BasicWindow() is already created. You can not change it to Vertical now (TODO: fix this)")
return
}
w.vertical = true
log.Log(INFO, "BasicWindow() w.vertical =", w.vertical)
}
func (w *BasicWindow) Make() {
if ! w.Initialized() {return}
// various timeout settings
w.win = w.parent.RawWindow(w.name)
w.win.Custom = func() {
log.Warn("BasicWindow.Custom() closed. TODO: handle this", w.name)
}
if w.vertical {
w.box = w.win.NewBox("bw vbox", false)
log.Log(INFO, "BasicWindow.Custom() made vbox")
} else {
w.box = w.win.NewBox("bw hbox", true)
log.Log(INFO, "BasicWindow.Custom() made hbox")
}
w.ready = true
}
func (w *BasicWindow) Draw() {
if ! w.Initialized() {return}
// various timeout settings
w.win = w.parent.NewWindow(w.name)
w.win.Custom = func() {
log.Warn("BasicWindow.Custom() closed. TODO: handle this", w.name)
}
if w.vertical {
w.box = w.win.NewBox("bw vbox", false)
log.Log(INFO, "BasicWindow.Custom() made vbox")
} else {
w.box = w.win.NewBox("bw hbox", true)
log.Log(INFO, "BasicWindow.Custom() made hbox")
}
w.ready = true
}
func NewBasicWindow(parent *gui.Node, name string) *BasicWindow {
var w *BasicWindow
w = &BasicWindow {
parent: parent,
name: name,
vertical: false,
}
return w
}

View File

@ -5,10 +5,10 @@
package gadgets
import (
"log"
"fmt"
"time"
"go.wit.com/log"
"go.wit.com/gui/gui"
)
@ -42,13 +42,13 @@ func (n *Duration) Set(d time.Duration) {
timeRange = n.High - n.Low
step = timeRange / 1000
if (step == 0) {
log.Println("duration.Set() division by step == 0", n.Low, n.High, timeRange, step)
log.Log(INFO, "duration.Set() division by step == 0", n.Low, n.High, timeRange, step)
n.s.Set(0)
return
}
offset = d - n.Low
i := int(offset / step)
log.Println("duration.Set() =", n.Low, n.High, d, "i =", i)
log.Log(INFO, "duration.Set() =", n.Low, n.High, d, "i =", i)
n.s.I = i
n.s.Set(i)
n.s.Custom()

10
go.mod
View File

@ -3,15 +3,13 @@ module go.wit.com/gui/gadgets
go 1.21.4
require (
go.wit.com/gui/gui v0.9.6
go.wit.com/log v0.0.0-20240101060000-bf41970f7793
go.wit.com/gui/gui v0.10.3
go.wit.com/log v0.4.2
)
require (
github.com/alexflint/go-arg v1.4.3 // indirect
github.com/alexflint/go-scalar v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
go.wit.com/gui/toolkits v0.4.1 // indirect
go.wit.com/spew v0.0.0-20240101141411-c7b8e91573c9 // indirect
)

25
go.sum
View File

@ -7,23 +7,18 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
go.wit.com/gui/gui v0.9.6 h1:AKR440dwS2bguC4QTNlfrjcur2LvRn000zbjtPO0M0w=
go.wit.com/gui/gui v0.9.6/go.mod h1:H2+uDT6qoQ8UkV6QUNIC1MQsgy6/aAop0zWBHnwACso=
go.wit.com/log v0.0.0-20240101060000-bf41970f7793 h1:kLs+rU96k6b48DqpkO4n3yDZ8hjiVnYjzPSEHU+93aY=
go.wit.com/log v0.0.0-20240101060000-bf41970f7793/go.mod h1:uXgfF8oPx5KYhtNZel6gsFYPMr9+z6sav5lSws1mN6A=
go.wit.com/gui/gui v0.10.3 h1:plWd7trEZ0QuR0D1zGK01RXJAmoLoVK2KqLJY0pZGRc=
go.wit.com/gui/gui v0.10.3/go.mod h1:xT5B88UTZORtfJ11CJB/vRb7Mj0rk4PLB/HpVNkF0Yo=
go.wit.com/gui/toolkits v0.4.1 h1:Kw9gTAajHwQShuK8MOj8UizGPeY5hOtDfvAxYpDXjUw=
go.wit.com/gui/toolkits v0.4.1/go.mod h1:f2QuC3z15/JxNnwujyFkgvkYjBS1fy0ni+QQ9idZnWQ=
go.wit.com/log v0.4.2 h1:oYCOD7qCY0A+LsrQXPv5ETtVyD8AhIHgvNBMdly9hy0=
go.wit.com/log v0.4.2/go.mod h1:EZLvivLZpMoXl5AUBArH0zsIgr+c+WyNXm14BCF+sdw=
go.wit.com/spew v0.0.0-20240101141411-c7b8e91573c9 h1:UEX2EzLQPzLTfy/kUFQD7OXtvKn8wk/+jpDOkbl4ff4=
go.wit.com/spew v0.0.0-20240101141411-c7b8e91573c9/go.mod h1:qBpgJXThMMT15vym7/E4Ur9y8oOo2nP7t2RP52QHUNw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

64
logFlag.go Normal file
View File

@ -0,0 +1,64 @@
/*
A log.Flag
-----------------------------------------------
| | |
| [ X ] | INFO (controls log.Info() |
| | |
-----------------------------------------------
*/
package gadgets
import (
"go.wit.com/log"
"go.wit.com/gui/gui"
)
type LogFlag struct {
p *gui.Node // parent widget
c *gui.Node // checkbox widget
Name string
Subsystem string
Desc string
Default bool
b bool
Custom func()
}
func (f *LogFlag) Get() bool {
return log.Get(f.Subsystem, f.Name)
}
func (f *LogFlag) Set(b bool) {
log.Info("LogFlag.Set() =", b)
log.Set(f.Subsystem, f.Name, b)
f.c.Set(b)
}
func (f *LogFlag) SetDefault() {
log.Info("LogFlag.SetDefault() =", f.Default)
log.Set(f.Subsystem, f.Name, f.Default)
f.c.Set(f.Default)
}
func NewLogFlag(n *gui.Node, lf *log.LogFlag) *LogFlag {
f := LogFlag {
Name: lf.Name,
Subsystem: lf.Subsystem,
Desc: lf.Desc,
Default: lf.Default,
p: n,
}
// various timeout settings
f.c = n.NewCheckbox(f.Name + ": " + f.Desc)
f.c.Custom = func() {
log.Set(f.Subsystem, f.Name, f.c.B)
log.Info("LogFlag.Custom() user changed value to =", log.Get(f.Subsystem, f.Name))
}
f.c.Set(lf.B)
return &f
}

View File

@ -1,72 +0,0 @@
package gadgets
import (
"go.wit.com/log"
"go.wit.com/gui/gui"
)
var myLogGui *LogSettings
type LogSettings struct {
ready bool
hidden bool
err error
parent *gui.Node // should be the root of the 'gui' package binary tree
window *gui.Node // our window for displaying the log package settings
group *gui.Node //
grid *gui.Node //
// Primary Directives
status *OneLiner
summary *OneLiner
}
// This is initializes the main DO object
// You can only have one of these
func NewLogSettings(p *gui.Node) *LogSettings {
if myLogGui != nil {return myLogGui}
myLogGui = new(LogSettings)
myLogGui.parent = p
myLogGui.ready = false
myLogGui.window = p.NewWindow("Log Settings")
// make a group label and a grid
myLogGui.group = myLogGui.window.NewGroup("droplets:").Pad()
myLogGui.grid = myLogGui.group.NewGrid("grid", 2, 1).Pad()
myLogGui.ready = true
myLogGui.Hide()
return myLogGui
}
// Returns true if the status is valid
func (d *LogSettings) Ready() bool {
if d == nil {return false}
return d.ready
}
func (d *LogSettings) Show() {
if ! d.Ready() {return}
log.Info("LogSettings.Show() window")
if d.hidden {
d.window.Show()
}
d.hidden = false
}
func (d *LogSettings) Hide() {
if ! d.Ready() {return}
log.Info("LogSettings.Hide() window")
if ! d.hidden {
d.window.Hide()
}
d.hidden = true
}
func (d *LogSettings) Update() bool {
if ! d.Ready() {return false}
return true
}

129
logsettings/draw.go Normal file
View File

@ -0,0 +1,129 @@
package logsettings
import (
"go.wit.com/log"
"go.wit.com/gui/gui"
"go.wit.com/gui/gadgets"
)
func (d *LogSettings) Show() {
if ! d.Ready() { return }
d.win.Show()
}
func (d *LogSettings) Hide() {
if ! d.Ready() { return }
d.win.Hide()
}
// alternates between showing and hiding the window
func (d *LogSettings) Toggle() {
if ! d.Ready() { return }
d.win.Toggle()
}
// Let's you toggle on and off the various types of debugging output
// These checkboxes should be in the same order as the are printed
func (d *LogSettings) draw() {
var g *gui.Node
d.win = gadgets.NewBasicWindow(d.parent, "Debug Flags")
g = d.win.Box().NewGroup("Show").Pad()
d.buttonG = g
g.NewButton("Redirect STDOUT to /tmp/", func () {
log.SetTmp()
})
g.NewButton("restore defaults", func () {
for _, wg := range myLogGui.groups {
for _, f := range wg.flags {
f.SetDefault()
}
}
})
g.NewButton("all on", func () {
for _, wg := range myLogGui.groups {
for _, f := range wg.flags {
f.Set(true)
}
}
})
g.NewButton("all off", func () {
for _, wg := range myLogGui.groups {
for _, f := range wg.flags {
f.Set(false)
}
}
})
g.NewButton("Dump Flags", func () {
// ShowDebugValues()
log.ShowFlags()
for s, wg := range myLogGui.groups {
log.Log(true, "Dump Flags", s)
for _, f := range wg.flags {
log.Log(true, "Dump Flags\t", f.Get(), f.Name, ":", f.Desc)
}
}
})
d.flagG = d.win.Box().NewGroup("Subsystem (aka package)")
g.NewButton("Add all Flags", func () {
flags := log.ShowFlags()
for _, f := range flags {
addFlag(d.flagG, f)
}
})
g.NewButton("Close", func () {
d.Hide()
})
flags := log.ShowFlags()
for _, f := range flags {
log.Log(true, "Get() ", "(" + f.Subsystem + ")", f.Name, "=", f.B, ":", f.Desc)
addFlag(d.flagG, f)
}
}
func addFlag(p *gui.Node, newf *log.LogFlag) {
var flagWidgets *flagGroup
if newf == nil { return }
if p == nil { return }
if myLogGui.groups[newf.Subsystem] == nil {
flagWidgets = new(flagGroup)
flagWidgets.parent = p
flagWidgets.name = newf.Subsystem
flagWidgets.group = p.NewGroup(newf.Subsystem)
flagWidgets.grid = flagWidgets.group.NewGrid("flags grid", 3, 1)
myLogGui.groups[newf.Subsystem] = flagWidgets
} else {
flagWidgets = myLogGui.groups[newf.Subsystem]
}
for _, f := range flagWidgets.flags {
if f.Name == newf.Name {
log.Info("addFlag() FOUND FLAG", f)
return
}
}
log.Info("addFlag() Adding new flag:", newf.Subsystem, newf.Name)
newWidget := gadgets.NewLogFlag(flagWidgets.grid, newf)
flagWidgets.flags = append(flagWidgets.flags, newWidget)
}
type flagGroup struct {
name string // should be set to the flag.Subsystem
parent *gui.Node // where to draw our group
group *gui.Node
grid *gui.Node
// the widget for each flag
flags []*gadgets.LogFlag
}

43
logsettings/settings.go Normal file
View File

@ -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
}

22
logsettings/structs.go Normal file
View File

@ -0,0 +1,22 @@
package logsettings
import (
"go.wit.com/gui/gui"
"go.wit.com/gui/gadgets"
)
var myLogGui *LogSettings
type LogSettings struct {
ready bool
hidden bool
err error
groups map[string]*flagGroup
parent *gui.Node // where to draw our window
win *gadgets.BasicWindow // our window for displaying the log package settings
buttonG *gui.Node // the group of buttons
flagG *gui.Node // the group of all the flag checkbox widgets
}

View File

@ -30,7 +30,7 @@ func (n *OneLiner) Get() string {
}
func (n *OneLiner) Set(value string) *OneLiner {
log.Println("OneLiner.Set() =", value)
log.Log(INFO, "OneLiner.Set() =", value)
if (n.v != nil) {
n.v.Set(value)
}
@ -49,7 +49,7 @@ func NewOneLiner(n *gui.Node, name string) *OneLiner {
d.v = n.NewLabel("")
d.v.Custom = func() {
d.value = d.v.S
log.Println("OneLiner.Custom() user changed value to =", d.value)
log.Log(INFO, "OneLiner.Custom() user changed value to =", d.value)
}
return &d