ATK是Go语言的Tcl/Tk绑定图形库。
gogetgithub.com/visualfc/atk安装Tcl/Tkhttps://www.tcl-lang.org
MacOSX,Windowshttps://www.activestate.com/activetcl/downloads
Ubuntu$sudoaptinstalltk-devCentOS$sudoyuminstalltk-develDemohttps://github.com/visualfc/atk_demo
Samplepackagemainimport( "github.com/visualfc/atk/tk")typeWindowstruct{ *tk.Window}funcNewWindow()*Window{ mw:=&Window{tk.RootWindow()} lbl:=tk.NewLabel(mw,"HelloATK") btn:=tk.NewButton(mw,"Quit") btn.OnCommand(func(){ tk.Quit() }) tk.NewVPackLayout(mw).AddWidgets(lbl,tk.NewLayoutSpacer(mw,0,true),btn) mw.ResizeN(300,200) returnmw}funcmain(){ tk.MainLoop(func(){ mw:=NewWindow() mw.SetTitle("ATKSample") mw.Center() mw.ShowNormal() })}
评论