标签:
package main
import "github.com/nsf/gothic"
const init_script = `
catch { destroy .clock errorswindow }
set w [ toplevel .clock ]
wm withdraw .
wm title $::w "clock"
tk appname "clock"
wm overrideredirect $::w 1
wm geometry $::w "+690+0"
set ::time 12:00
label $::w.digital -textvar ::time -font "Arial 28" -fg white -bg #000000
pack $::w.digital
bind . <Up> {exec wish &; exit}
`
func main() {
ir := gothic.NewInterpreter(init_script)
<-ir.Done
}
//这是一段无框窗体的tcl/tk代码,目前不知道如何绑定按键让其正常退出
//运行效果如下
标签:
原文地址:http://my.oschina.net/u/2315579/blog/408878