diff options
Diffstat (limited to 'area.go')
| -rw-r--r-- | area.go | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -24,7 +24,7 @@ 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 + // ah.FontButton = newB.FB time.Sleep(200 * time.Millisecond) tmp := findFB(newB) @@ -45,14 +45,14 @@ func makeSplashArea(ah *AreaHandler) { log.Println("makeSplashArea() tmp =", tmp, "newB", newB) // log.Println("makeSplashArea() ah =", ah) - log.Println("makeSplashArea() ah.FontButton =", ah.FontButton) + // 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.FontButton = Data.AllButtons[1].FB ah.Button = &Data.AllButtons[1] if (Data.Debug) { @@ -84,7 +84,7 @@ func appendWithAttributes(newText *ui.AttributedString, what string, attrs ...ui func (ah AreaHandler) Draw(a *ui.Area, p *ui.AreaDrawParams) { tl := ui.DrawNewTextLayout(&ui.DrawTextLayoutParams{ String: ah.Attrstr, - DefaultFont: ah.FontButton.Font(), + DefaultFont: ah.Button.FB.Font(), Width: p.AreaWidth, Align: ui.DrawTextAlign(1), }) @@ -94,17 +94,20 @@ func (ah AreaHandler) Draw(a *ui.Area, p *ui.AreaDrawParams) { func (ah AreaHandler) MouseEvent(a *ui.Area, me *ui.AreaMouseEvent) { if (Data.Debug) { - log.Println("GOT MouseEvent()") + log.Println("GOT MouseEvent() ah.Button =", ah.Button) spew.Dump(me) } if (me.Down == 1) { log.Println("GOT MOUSE DOWN") + log.Println("GOT MOUSE DOWN ah.Button =", ah.Button) + log.Println("GOT MOUSE UP ah.Button.FB =", ah.Button.FB) } 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.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) } } |
