parent
602dd0de2d
commit
22760127b9
15
area.go
15
area.go
|
@ -107,14 +107,16 @@ func (ah GuiArea) KeyEvent(a *ui.Area, ke *ui.AreaKeyEvent) (handled bool) {
|
|||
return false
|
||||
}
|
||||
|
||||
func ShowTextBox(gw *GuiWindow, newText *ui.AttributedString, custom func(*GuiButton), name string) *GuiBox {
|
||||
func ShowTextBox(box *GuiBox, newText *ui.AttributedString, custom func(*GuiButton), name string) {
|
||||
log.Println("ShowTextBox() START")
|
||||
gw := box.Window
|
||||
if (gw == nil) {
|
||||
log.Println("ShowTextBox() ERROR gw = nil")
|
||||
return nil
|
||||
return
|
||||
}
|
||||
log.Println("ShowTextBox() START gw =", gw)
|
||||
|
||||
/*
|
||||
var newbox *GuiBox
|
||||
newbox = new(GuiBox)
|
||||
newbox.Window = gw
|
||||
|
@ -124,11 +126,10 @@ func ShowTextBox(gw *GuiWindow, newText *ui.AttributedString, custom func(*GuiBu
|
|||
|
||||
// TODO: allow padded & axis here
|
||||
hbox.SetPadded(true)
|
||||
*/
|
||||
|
||||
add(gw.BoxMap["MAINBOX"], newbox)
|
||||
// add(gw.BoxMap["MAINBOX"], newbox)
|
||||
|
||||
makeGenericArea(newbox, newText, custom)
|
||||
newbox.UiBox.Append(newbox.Window.Area.UiArea, true)
|
||||
|
||||
return newbox
|
||||
makeGenericArea(box, newText, custom)
|
||||
box.UiBox.Append(box.Window.Area.UiArea, true)
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ type GuiWindow struct {
|
|||
TabNumber *int // the andlabs/ui tab index
|
||||
|
||||
// the callback function to make the window contents
|
||||
MakeWindow func(*GuiWindow) *GuiBox
|
||||
MakeWindow func(*GuiBox) *GuiBox
|
||||
|
||||
// the components of the window
|
||||
BoxMap map[string]*GuiBox
|
||||
|
|
|
@ -7,7 +7,7 @@ import "time"
|
|||
import "github.com/andlabs/ui"
|
||||
import _ "github.com/andlabs/ui/winmanifest"
|
||||
|
||||
func StartNewWindow(bg bool, name string, axis int, callback func(*GuiWindow) *GuiBox) {
|
||||
func StartNewWindow(bg bool, name string, axis int, callback func(*GuiBox) *GuiBox) {
|
||||
log.Println("StartNewWindow() Create a new window")
|
||||
var tmp GuiWindow
|
||||
tmp.MakeWindow = callback
|
||||
|
@ -52,9 +52,8 @@ func initTabWindow(gw *GuiWindow) {
|
|||
DumpBoxes()
|
||||
// for {}
|
||||
box := InitWindow(gw, gw.Name, gw.Axis)
|
||||
box = gw.MakeWindow(box)
|
||||
gw = box.Window
|
||||
|
||||
box = gw.MakeWindow(gw)
|
||||
log.Println("initTabWindow() END box =", box)
|
||||
log.Println("initTabWindow() END gw =", gw)
|
||||
gw.UiWindow.Show()
|
||||
|
@ -84,8 +83,10 @@ func InitWindow(gw *GuiWindow, name string, axis int) *GuiBox {
|
|||
|
||||
log.Println("InitGuiWindow() START")
|
||||
var newGuiWindow GuiWindow
|
||||
newGuiWindow.Width = Config.Width
|
||||
newGuiWindow.Height = Config.Height
|
||||
newGuiWindow.Width = Config.Width
|
||||
newGuiWindow.Height = 600
|
||||
newGuiWindow.Width = 800
|
||||
|
||||
newGuiWindow.Axis = axis
|
||||
newGuiWindow.MakeWindow = gw.MakeWindow
|
||||
|
|
Loading…
Reference in New Issue