clean up the code more
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
4b73667186
commit
3bc6811811
|
@ -89,37 +89,16 @@ func format(mybut *ui.Button) {
|
|||
simpleProcess("dd if=../u-boot/u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1K seek=8")
|
||||
}
|
||||
|
||||
func hostnameButton(hostname string, something func(*ui.Button)) ui.Control {
|
||||
tmpbox := ui.NewHorizontalBox()
|
||||
tmpbox.SetPadded(true)
|
||||
func addButton(vbox *ui.Box, label string, click func(*ui.Button)) {
|
||||
hbox := ui.NewHorizontalBox()
|
||||
hbox.SetPadded(true)
|
||||
|
||||
tmpButton := ui.NewButton(hostname)
|
||||
tmpbox.Append(tmpButton, false)
|
||||
tmpButton.OnClicked(something)
|
||||
/*
|
||||
tmpButton.OnClicked(func(*ui.Button) {
|
||||
log.Println("hostname =", config.String("hostname"), tmpButton)
|
||||
})
|
||||
*/
|
||||
// look up translation here for 'label'
|
||||
button := ui.NewButton(label)
|
||||
hbox.Append(button, false)
|
||||
button.OnClicked(click)
|
||||
|
||||
return tmpbox
|
||||
}
|
||||
|
||||
func addButton(vbox *ui.Box, hostname string, buttonClick func(*ui.Button)) {
|
||||
tmpbox := ui.NewHorizontalBox()
|
||||
tmpbox.SetPadded(true)
|
||||
|
||||
/*
|
||||
tmpButton := ui.NewButton(hostname)
|
||||
tmpbox.Append(tmpButton, false)
|
||||
tmpButton.OnClicked(doButton)
|
||||
log.Println("addButton() set doButton =", tmpButton)
|
||||
tmpButton.OnClicked(func(*ui.Button) {
|
||||
log.Println("hostname =", config.String("hostname"), tmpButton)
|
||||
})
|
||||
*/
|
||||
|
||||
vbox.Append(hostnameButton(hostname, buttonClick), false)
|
||||
vbox.Append(hbox, false)
|
||||
}
|
||||
|
||||
func makeButtonsPage(names []string) ui.Control {
|
||||
|
|
Loading…
Reference in New Issue