more code deprecation
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
d4b3283484
commit
51b109a976
|
@ -48,7 +48,7 @@ func buttonWindow() {
|
||||||
log.Println("buttonWindow()")
|
log.Println("buttonWindow()")
|
||||||
log.Println("buttonWindow()")
|
log.Println("buttonWindow()")
|
||||||
|
|
||||||
w = myGui.NewWindow2(title)
|
w = myGui.NewWindow2(title).SetText("Nueva Ventana de Botones")
|
||||||
t = w.NewTab("buttonTab")
|
t = w.NewTab("buttonTab")
|
||||||
g = t.NewGroup("buttonGroup")
|
g = t.NewGroup("buttonGroup")
|
||||||
g1 := t.NewGroup("buttonGroup 2")
|
g1 := t.NewGroup("buttonGroup 2")
|
||||||
|
|
32
common.go
32
common.go
|
@ -52,7 +52,7 @@ func (n *Node) AddText(str string) {
|
||||||
newaction(&a, n, nil)
|
newaction(&a, n, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Node) SetText(text string) {
|
func (n *Node) SetText(text string) *Node{
|
||||||
log(debugChange, "SetText() value =", text)
|
log(debugChange, "SetText() value =", text)
|
||||||
|
|
||||||
n.Text = text
|
n.Text = text
|
||||||
|
@ -60,6 +60,7 @@ func (n *Node) SetText(text string) {
|
||||||
a.ActionType = toolkit.SetText
|
a.ActionType = toolkit.SetText
|
||||||
a.S = text
|
a.S = text
|
||||||
newaction(&a, n, nil)
|
newaction(&a, n, nil)
|
||||||
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Node) SetNext(x int, y int) {
|
func (n *Node) SetNext(x int, y int) {
|
||||||
|
@ -154,52 +155,57 @@ func commonCallback(n *Node) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Node) Margin() {
|
func (n *Node) Margin() *Node {
|
||||||
var a toolkit.Action
|
var a toolkit.Action
|
||||||
a.ActionType = toolkit.Margin
|
a.ActionType = toolkit.Margin
|
||||||
newaction(&a, n, nil)
|
newaction(&a, n, nil)
|
||||||
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Node) Unmargin() {
|
func (n *Node) Unmargin() *Node {
|
||||||
var a toolkit.Action
|
var a toolkit.Action
|
||||||
a.ActionType = toolkit.Unmargin
|
a.ActionType = toolkit.Unmargin
|
||||||
newaction(&a, n, nil)
|
newaction(&a, n, nil)
|
||||||
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Node) Pad() {
|
func (n *Node) Pad() *Node {
|
||||||
var a toolkit.Action
|
var a toolkit.Action
|
||||||
a.ActionType = toolkit.Pad
|
a.ActionType = toolkit.Pad
|
||||||
newaction(&a, n, nil)
|
newaction(&a, n, nil)
|
||||||
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Node) Unpad() {
|
func (n *Node) Unpad() *Node {
|
||||||
var a toolkit.Action
|
var a toolkit.Action
|
||||||
a.ActionType = toolkit.Unpad
|
a.ActionType = toolkit.Unpad
|
||||||
newaction(&a, n, nil)
|
newaction(&a, n, nil)
|
||||||
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
// is this better?
|
// is this better?
|
||||||
|
// yes, this is better. it allows Internationalization very easily
|
||||||
// me.window = myGui.New2().Window("DNS and IPv6 Control Panel").Standard()
|
// me.window = myGui.New2().Window("DNS and IPv6 Control Panel").Standard()
|
||||||
|
// myFunnyWindow = myGui.New().Window("Hello").Standard().SetText("Hola")
|
||||||
|
|
||||||
func (n *Node) New2() *Node {
|
func (n *Node) New2() *Node {
|
||||||
var newWin *Node
|
log(debugNow, "New2() Start")
|
||||||
newWin = NewWindow()
|
return n.NewWindow2("New2")
|
||||||
log(debugError, "New2() END Main(f)")
|
|
||||||
return newWin
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Node) Window(title string) *Node {
|
func (n *Node) Window(title string) *Node {
|
||||||
log(debugError, "Window()", n)
|
log(debugError, "Window()", n)
|
||||||
n.SetText(title)
|
return n.NewWindow2(title)
|
||||||
return n
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This should not really do anything. as per the docs, the "Standard()" way
|
||||||
|
// should be the default way
|
||||||
func (n *Node) Standard() *Node {
|
func (n *Node) Standard() *Node {
|
||||||
log(debugError, "Standard()")
|
log(debugError, "Standard() not implemented yet")
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Node) DoMargin() *Node {
|
func (n *Node) DoMargin() *Node {
|
||||||
log(debugError, "DoMargin()")
|
log(debugError, "DoMargin() not implemented yet")
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,8 +61,8 @@ func (n *Node) NewWindow2(title string) *Node {
|
||||||
a.ActionType = toolkit.Add
|
a.ActionType = toolkit.Add
|
||||||
a.Width = Config.Width
|
a.Width = Config.Width
|
||||||
a.Height = Config.Height
|
a.Height = Config.Height
|
||||||
a.Name = Config.Title
|
a.Name = title
|
||||||
a.Text = Config.Title
|
a.Text = title
|
||||||
newaction(&a, newNode, n)
|
newaction(&a, newNode, n)
|
||||||
|
|
||||||
return newNode
|
return newNode
|
||||||
|
|
Loading…
Reference in New Issue