diff options
| -rw-r--r-- | Makefile | 5 | ||||
| -rw-r--r-- | basicCombobox.go | 4 | ||||
| -rw-r--r-- | basicWindow.go | 4 | ||||
| -rw-r--r-- | logFlag.go | 18 | 
4 files changed, 17 insertions, 14 deletions
@@ -1,5 +1,5 @@  #a git remote add github [email protected]:wit-go/gadgets.git -all: +all: goimports vet  	@echo  	@echo gadgets are collections of widget primaties that work  	@echo in ways that are common enough they are generally useful @@ -14,6 +14,9 @@ all:  goimports:  	goimports -w *.go +vet: +	@GO111MODULE=off go vet +  redomod:  	rm -f go.*  	GO111MODULE= go mod init diff --git a/basicCombobox.go b/basicCombobox.go index 8377f3f..bc21f7e 100644 --- a/basicCombobox.go +++ b/basicCombobox.go @@ -20,8 +20,8 @@ type BasicCombobox struct {  	ready    bool  	progname string -	l      *gui.Node // label widget -	d      *gui.Node // dropdown widget +	l *gui.Node // label widget +	d *gui.Node // dropdown widget  	Custom func()  } diff --git a/basicWindow.go b/basicWindow.go index 378fee3..731f372 100644 --- a/basicWindow.go +++ b/basicWindow.go @@ -15,8 +15,8 @@ type BasicWindow struct {  	title    string  	// parent *gui.Node -	win    *gui.Node // window widget -	box    *gui.Node // box +	win *gui.Node // window widget +	box *gui.Node // box  	Custom func()  } @@ -32,12 +32,12 @@ type LogFlag struct {  // probably a better name than GetValue()  func (f *LogFlag) Bool() bool { -	if f.lf.Bool() != f.checkbox.Bool() { +	if f.lf.Enabled() != f.checkbox.Bool() {  		log.Error(errors.New("gadget.LogFlag error. actual flag.Bool() does not match checkbox.Bool()"))  		// set the checkbox to reflect the actual flag value -		f.checkbox.SetChecked(f.lf.Bool()) +		f.checkbox.SetChecked(f.lf.Enabled())  	} -	return f.lf.Bool() +	return f.lf.Enabled()  }  func (f *LogFlag) GetValue() bool { @@ -57,10 +57,10 @@ func (f *LogFlag) GetDesc() string {  }  func (f *LogFlag) SetValue(b bool) { -	log.Log(GADGETS, "LogFlag.SetValue() before SetValue() log.flag =", f.lf.Bool(), "checkbox =", f.checkbox.Bool()) +	log.Log(GADGETS, "LogFlag.SetValue() before SetValue() log.flag =", f.lf.Enabled(), "checkbox =", f.checkbox.Bool())  	f.checkbox.SetChecked(b)  	f.lf.SetBool(b) -	log.Log(GADGETS, "LogFlag.SetValue() after SetValue() log.flag =", f.lf.Bool(), "checkbox =", f.checkbox.Bool()) +	log.Log(GADGETS, "LogFlag.SetValue() after SetValue() log.flag =", f.lf.Enabled(), "checkbox =", f.checkbox.Bool())  }  // should be RestoreDefault() ? @@ -94,11 +94,11 @@ func NewLogFlag(n *gui.Node, lf *log.LogFlag) *LogFlag {  	f.checkbox.Custom = func() {  		if counter == 0 {  			// store the first clicked value -			watcher = f.lf.Bool() +			watcher = f.lf.Enabled()  		} else {  			// if the value has changed, then everything is fine -			if watcher != f.lf.Bool() { -				watcher = f.lf.Bool() +			if watcher != f.lf.Enabled() { +				watcher = f.lf.Enabled()  				counter = 0  			}  			// this means the value has not changed 3 times @@ -114,7 +114,7 @@ func NewLogFlag(n *gui.Node, lf *log.LogFlag) *LogFlag {  		f.lf.SetBool(f.checkbox.Bool())  	} -	f.checkbox.SetChecked(lf.Bool()) +	f.checkbox.SetChecked(lf.Enabled())  	return &f  }  | 
