XTERM: more xterm configuration options
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
0dccc86000
commit
e7042580fc
|
@ -13,18 +13,7 @@ func mainWindow(w *gui.Node) *gui.Node {
|
||||||
w = gui.NewWindow()
|
w = gui.NewWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
newTab := w.AddTab("Main Tab", nil)
|
// newTab := w.AddTab("Main Tab", nil)
|
||||||
|
|
||||||
////////////////////////// MAIN ////////////////////////////////
|
|
||||||
g1 := newTab.AddGroup("unsorted")
|
|
||||||
|
|
||||||
g1.AddButton("Generic SSH Window", func (*gui.Node) {
|
|
||||||
sshGenericWindow(nil)
|
|
||||||
})
|
|
||||||
|
|
||||||
g1.AddButton("update DNS (IPv6)", func (*gui.Node) {
|
|
||||||
updateDNS(nil)
|
|
||||||
})
|
|
||||||
|
|
||||||
tabResets(w)
|
tabResets(w)
|
||||||
|
|
||||||
|
@ -32,5 +21,5 @@ func mainWindow(w *gui.Node) *gui.Node {
|
||||||
|
|
||||||
golangDebug(w)
|
golangDebug(w)
|
||||||
|
|
||||||
return newTab
|
return w
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,18 +16,32 @@ func tabResets(w *gui.Node) *gui.Node {
|
||||||
newTab := w.AddTab("tabResets()", nil)
|
newTab := w.AddTab("tabResets()", nil)
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
gNode2 := newTab.AddGroup("reset windows")
|
g1 := newTab.AddGroup("reset windows")
|
||||||
|
|
||||||
gNode2.NewLabel("Working Stuff")
|
g1.NewLabel("Working Stuff")
|
||||||
|
|
||||||
gNode2.AddButton("resolv.conf", func (*gui.Node) {
|
g1.AddButton("Generic SSH Window", func (*gui.Node) {
|
||||||
|
sshGenericWindow(nil)
|
||||||
|
})
|
||||||
|
|
||||||
|
g1.AddButton("Configure xterm", func (*gui.Node) {
|
||||||
|
xtermSettings(nil)
|
||||||
|
})
|
||||||
|
|
||||||
|
g1.AddButton("Configure resolv.conf", func (*gui.Node) {
|
||||||
log.Println("supposed to make the resolv.conf window")
|
log.Println("supposed to make the resolv.conf window")
|
||||||
resolvWindow(nil)
|
resolvWindow(nil)
|
||||||
})
|
})
|
||||||
|
|
||||||
gNode2.AddButton("Set xterm Font Size", func (*gui.Node) {
|
g1.AddButton("update DNS (IPv6)", func (*gui.Node) {
|
||||||
// gui.CreateWindow("Set xterm Font Size", "vars", 200, 200, makeWindowXresources)
|
updateDNS(nil)
|
||||||
xtermSettings(w)
|
})
|
||||||
|
|
||||||
|
g1.AddButton("fontNode.GetText()", func (*gui.Node) {
|
||||||
|
if (fontNode != nil) {
|
||||||
|
fontsize = fontNode.GetText()
|
||||||
|
log.Println("set fontsize =", fontsize)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -2,7 +2,7 @@ package main
|
||||||
|
|
||||||
import "log"
|
import "log"
|
||||||
import "os/user"
|
import "os/user"
|
||||||
import "reflect"
|
// import "reflect"
|
||||||
import "git.wit.org/wit/gui"
|
import "git.wit.org/wit/gui"
|
||||||
|
|
||||||
var userNode *gui.Node
|
var userNode *gui.Node
|
||||||
|
@ -64,19 +64,3 @@ func sshGenericWindow(w *gui.Node) {
|
||||||
xterm(cmd)
|
xterm(cmd)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeSSHbutton (n *gui.Node, name string, hostname string) {
|
|
||||||
bNode := n.AddButton(name, func (*gui.Node) {
|
|
||||||
var tmp []string
|
|
||||||
if (username == "") {
|
|
||||||
username = "root"
|
|
||||||
}
|
|
||||||
junk := "ssh -v " + username + "@" + hostname
|
|
||||||
log.Println("junk = " , junk)
|
|
||||||
log.Println("username = '" + username + "'")
|
|
||||||
xterm(junk)
|
|
||||||
log.Println("tmp = " , reflect.ValueOf(tmp).Kind())
|
|
||||||
// spew.Dump(tmp)
|
|
||||||
})
|
|
||||||
bNode.Dump()
|
|
||||||
}
|
|
||||||
|
|
|
@ -5,32 +5,28 @@ import "log"
|
||||||
import "io/ioutil"
|
import "io/ioutil"
|
||||||
import "git.wit.org/wit/gui"
|
import "git.wit.org/wit/gui"
|
||||||
|
|
||||||
|
var fontNode *gui.Node
|
||||||
|
var fontsize string = ""
|
||||||
|
|
||||||
func xtermSettings(w *gui.Node) {
|
func xtermSettings(w *gui.Node) {
|
||||||
if (w == nil) {
|
if (w == nil) {
|
||||||
gui.Config.Title = "xterm font setting"
|
gui.Config.Title = "Configure xterm"
|
||||||
gui.Config.Width = 105
|
gui.Config.Width = 105
|
||||||
gui.Config.Height = 105
|
gui.Config.Height = 105
|
||||||
gui.Config.Exit = customExit
|
gui.Config.Exit = nil
|
||||||
w = gui.NewWindow()
|
w = gui.NewWindow()
|
||||||
}
|
}
|
||||||
|
|
||||||
tab := w.AddTab("xtermSettings()", nil)
|
tab := w.AddTab("xtermSettings()", nil)
|
||||||
// populateNEW(tab, "new")
|
|
||||||
|
|
||||||
////////////// filename /////////////////////////
|
// Select your fontsize
|
||||||
gNode := tab.AddGroup("filename")
|
gNode := tab.AddGroup("fontsize")
|
||||||
fontsize := "16"
|
fontsize = "16"
|
||||||
|
fontNode = gNode.AddComboBox("fontsize", "8", "12", "16", "24", "32")
|
||||||
resolvNode := gNode.AddComboBox("8",
|
fontNode.OnChanged = func () {
|
||||||
"16",
|
fontsize = fontNode.GetText()
|
||||||
"24")
|
|
||||||
|
|
||||||
resolvNode.SetText("12")
|
|
||||||
resolvNode.OnChanged = func () {
|
|
||||||
log.Println("STARTED HOSTNAME")
|
|
||||||
fontsize = resolvNode.GetText()
|
|
||||||
log.Println("ENDED GetText() HOSTNAME =", fontsize)
|
|
||||||
}
|
}
|
||||||
|
fontNode.SetText(fontsize)
|
||||||
|
|
||||||
////////////// connect /////////////////////////
|
////////////// connect /////////////////////////
|
||||||
gNode = tab.AddGroup("Update")
|
gNode = tab.AddGroup("Update")
|
||||||
|
@ -49,4 +45,9 @@ func xtermSettings(w *gui.Node) {
|
||||||
xterm(cmd)
|
xterm(cmd)
|
||||||
log.Println("button click end")
|
log.Println("button click end")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
gNode.AddButton("test xterm", func (*gui.Node) {
|
||||||
|
cmd := "xterm"
|
||||||
|
xterm(cmd)
|
||||||
|
})
|
||||||
}
|
}
|
Loading…
Reference in New Issue