GTK+3 的 Go 绑定 gotk3

码农软件 · 软件分类 · GUI开发框架 · 2019-08-07 23:14:50

软件介绍

gotk3 提供 Go 绑定 GTK+3 和依赖的其他项目。每个组件都给出了用来导入包路径的子目录。以下是部分已经实施的支持库:

  • GTK+3 (3.6 and later)

  • GDK 3 (3.6 and later)

  • GLib 2 (2.36 and later)

  • Cairo (1.10 and later)

已经采取谨慎的内存管理与Go的垃圾收集器无缝工作,而无需使用或理解图形对象的浮动参考。

简单示例:

package main
import (
    "github.com/conformal/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()
}

本文地址:https://codercto.com/soft/d/11881.html

互联网时代

互联网时代

《互联网时代》主创团队 / 北京联合出版公司 / 2015-2-1 / 49.80元

【编辑推荐】 1、人类正进入一个充满未知的时代,《互联网时代》不仅告诉你现在,还告诉你未来。 2、中央电视台《互联网时代》是全球第一部全面、系统、深入、客观解析互联网的纪录片,同名图书容量巨大,除纪录片内容,更包含大量尚未播出的内容。 3、中央电视台继《大国崛起》《公司的力量》《华尔街》等之后的又一重磅力作。10个摄影组,制作近3年,在全球14个国家和地区拍摄,6位“互联网之父”......一起来看看 《互联网时代》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具