summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-05-29 10:49:29 -0700
committerJeff Carr <[email protected]>2019-05-29 10:49:29 -0700
commitbe2a69804a5b8823d450ec5a478766c3d8f4acac (patch)
treede1333d86e72c1aa894db6c4ece8ba47bec52b99
parent8574f8109dde05aadcbdf0423b8347d2d17a4bce (diff)
fix crash
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--area.go17
-rw-r--r--gui.go1
2 files changed, 15 insertions, 3 deletions
diff --git a/area.go b/area.go
index d3498ef..1cb8e67 100644
--- a/area.go
+++ b/area.go
@@ -24,13 +24,13 @@ func makeSplashArea() *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")
+ myAH.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)
- newB.AH = &myAH
// log.Println("makeSplashArea() newB.AH =", newB.AH)
log.Println("makeSplashArea() newB =", newB)
@@ -38,11 +38,22 @@ func makeSplashArea() *AreaHandler {
tmp = findFB(newB)
log.Println("makeSplashArea() tmp =", tmp, "newB", newB)
+ Data.AllButtons[1].AH = &myAH
+
+ time.Sleep(200 * time.Millisecond)
+ tmp = findFB(newB)
+ log.Println("makeSplashArea() tmp =", tmp, "newB", newB)
+
+ // log.Println("makeSplashArea() ah =", myAH)
+ log.Println("makeSplashArea() ah.FontButton =", myAH.FontButton)
+ // DefaultFont: ah.FontButton.Font(),
+
myAH.Attrstr = makeAttributedString()
myAH.Area = ui.NewArea(myAH)
newB.A = myAH.Area
- myAH.FontButton = newB.FB
- myAH.Button = newB
+ Data.AllButtons[1].A = myAH.Area
+ myAH.FontButton = Data.AllButtons[1].FB
+ myAH.Button = &Data.AllButtons[1]
if (Data.Debug) {
spew.Dump(myAH.Area)
diff --git a/gui.go b/gui.go
index 1bf40cf..58a9bd2 100644
--- a/gui.go
+++ b/gui.go
@@ -232,6 +232,7 @@ func CreateFontButton(action string) *ButtonMap {
var newBM ButtonMap
newBM.Action = action
newBM.FB = newB
+ newBM.AH = &myAH
Data.AllButtons = append(Data.AllButtons, newBM)
newB.OnChanged(func (*ui.FontButton) {