gotk

command module
v0.0.0-...-468dc22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2020 License: BSD-2-Clause Imports: 1 Imported by: 0

README

goTk -- графика Tk для Go

goTk -- библиотека для Golang Tcl/Tk

go get github.com/prospero78/goTk
Установка Tcl/Tk

http://www.tcl-lang.org

Demo

https://github.com/prospero78/goTk/demotk

Sample
package main

import (
	tk "github.com/prospero78/goTk/libtk"
)

type Window struct {
	*tk.Window
}

func NewWindow() *Window {
	mw := &Window{tk.RootWindow()}
	lbl := tk.NewLabel(mw, "Привет, гофер!")
	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)
	return mw
}

func main() {
	tk.MainLoop(func() {
		mw := NewWindow()
		mw.SetTitle("Пример goTk")
		mw.Center()
		mw.ShowNormal()
	})
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL