1 Star 0 Fork 0

laogg/gotk3-examples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
ISC
gotk3 examples ============== The gotk3 project provides Go bindings for GTK+3 and dependent projects. ## Examples for gotk3 ## Sample Use The following example can be found in `gtk-examples/simple/simple.go`. Usage of additional features is also demonstrated in the `gtk-examples/` directory. ```Go package main import ( "github.com/gotk3/gotk3/gtk" "log" ) func main() { // Initialize GTK without parsing any command line arguments. gtk.Init(nil) // Create a new toplevel window, set its title, and connect it to the // "destroy" signal to exit the GTK main loop when it is destroyed. win, err := gtk.WindowNew(gtk.WINDOW_TOPLEVEL) if err != nil { log.Fatal("Unable to create window:", err) } win.SetTitle("Simple Example") win.Connect("destroy", func() { gtk.MainQuit() }) // Create a new label widget to show in the window. l, err := gtk.LabelNew("Hello, gotk3!") if err != nil { log.Fatal("Unable to create label:", err) } // Add the label to the window. win.Add(l) // Set the default window size. win.SetDefaultSize(800, 600) // Recursively show all widgets contained in this window. win.ShowAll() // Begin executing the GTK main loop. This blocks until // gtk.MainQuit() is run. gtk.Main() } ``` ## Installation gotk3 currently requires GTK 3.16, GLib 2.36-2.40, and Cairo 1.10 or 1.12. A recent Go (1.3 or newer) is also required. The gtk package requires the cairo, glib, and gdk packages as dependencies, so only one `go get` is necessary for complete installation. The build process uses the tagging scheme gtk_MAJOR_MINOR to specify a build targeting any particular GTK version (for example, gtk_3_10). Building with no tags defaults to targeting the latest supported GTK release (3.16). To install gotk3 targeting the latest GTK version: ```bash $ go get github.com/gotk3/gotk3/gtk ``` On MacOS (using homebrew) you would likely specify PKG_CONFIG_PATH as such: ```bash $ PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:`brew --prefix gtk+3`/lib/pkgconfig go get -u -v github.com/gotk3/gotk3/gdk ``` ```bash $ sudo apt-get install libgtk-3-dev $ sudo apt-get install libcairo2-dev $ sudo apt-get install libglib2.0-dev ``` ## License Package gotk3 is licensed under the liberal ISC License.

简介

暂无描述 展开 收起
ISC
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/laogg/gotk3-examples.git
[email protected]:laogg/gotk3-examples.git
laogg
gotk3-examples
gotk3-examples
master

搜索帮助