summaryrefslogtreecommitdiff
path: root/area.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-05-29 11:48:32 -0700
committerJeff Carr <[email protected]>2019-05-29 11:48:32 -0700
commit73804529267500c49f6321d2fb33c028c2c2fbef (patch)
tree493d340e8ab90f79931599f5ce54d7b2a0731e50 /area.go
parentd3819ea331dc12cb142b0a825f5e27b4a7441a53 (diff)
more dereference improvements
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'area.go')
-rw-r--r--area.go32
1 files changed, 3 insertions, 29 deletions
diff --git a/area.go b/area.go
index da2d2a6..8240b47 100644
--- a/area.go
+++ b/area.go
@@ -1,7 +1,7 @@
package gui
import "log"
-import "time"
+// import "time"
import "github.com/andlabs/ui"
import _ "github.com/andlabs/ui/winmanifest"
@@ -11,9 +11,9 @@ import "github.com/davecgh/go-spew/spew"
func findFB(button *ButtonMap) *ButtonMap {
var a *ButtonMap
for key, foo := range Data.AllButtons {
- log.Println("defaultButtonClick() Data.AllButtons =", key, foo)
- // if Data.AllButtons[key] == *button {
+ log.Println("findFB() Data.AllButtons key, foo=", key, foo)
if &foo == button {
+ log.Println("findFB() FOUND BUTTON key, foo=", key, foo)
a = &foo
}
}
@@ -24,35 +24,11 @@ func makeSplashArea(ah *AreaHandler) {
// make this button just to get the default font (but don't display the button)
// There should be another way to do this (?)
newB := CreateFontButton("AREA")
- // ah.FontButton = newB.FB
-
- time.Sleep(200 * time.Millisecond)
- tmp := findFB(newB)
- log.Println("makeSplashArea() newB =", newB)
- log.Println("makeSplashArea() newB.AH =", newB.AH)
- log.Println("makeSplashArea() newB =", newB)
- // log.Println("makeSplashArea() newB.AH =", newB.AH)
- log.Println("makeSplashArea() newB =", newB)
-
- time.Sleep(200 * time.Millisecond)
- tmp = findFB(newB)
- log.Println("makeSplashArea() tmp =", tmp, "newB", newB)
-
- Data.AllButtons[1].AH = ah
-
- time.Sleep(200 * time.Millisecond)
- tmp = findFB(newB)
- log.Println("makeSplashArea() tmp =", tmp, "newB", newB)
-
- // log.Println("makeSplashArea() ah =", ah)
- // log.Println("makeSplashArea() ah.FontButton =", ah.FontButton)
- // DefaultFont: ah.FontButton.Font(),
ah.Attrstr = makeAttributedString()
ah.Area = ui.NewArea(ah)
newB.A = ah.Area
Data.AllButtons[1].A = ah.Area
- // ah.FontButton = Data.AllButtons[1].FB
ah.Button = &Data.AllButtons[1]
if (Data.Debug) {
@@ -104,8 +80,6 @@ func (ah AreaHandler) MouseEvent(a *ui.Area, me *ui.AreaMouseEvent) {
}
if (me.Up == 1) {
log.Println("GOT MOUSE UP")
- // log.Println("GOT MOUSE UP ah", ah)
- // log.Println("GOT MOUSE UP ah.FontButton =", ah.FontButton)
log.Println("GOT MOUSE UP ah.Button =", ah.Button)
log.Println("GOT MOUSE UP ah.Button.FB =", ah.Button.FB)
mouseClick(ah.Button)