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