• Stars
    star
    152
  • Rank 244,685 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created about 13 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tcl/Tk Go bindings
Tcl/Tk Go bindings.

VERSION NOTICE

Recently Tcl/Tk 8.6 were released. I use them as a default, if you still have
Tcl/Tk 8.5 use `go get -tags tcl85 github.com/nsf/gothic`.

DESCRIPTION

In its current state the bindings are a bit Tk-oriented. You can't create an
interpreter instance without Tk. In future it's likely it will be changed.

The API is very simple. In the package you have one type and one function:

type Interpreter struct
func NewInterpreter (init interface{}) *Interpreter

In order to launch an interpreter you have to call the "NewInterpreter"
function, it will make a new instance of a tcl/tk interpreter in a separate
goroutine, execute "init", block in Tk's main loop and then the function
returns a pointer to the new instance of an "Interpreter".

"init" could be a string with tcl commands that are executed before Tk's main
loop, or a function with this signature: "func (*Interpreter)". This function
gets executed the same way as the string, that is - before Tk's main loop.

Here are the methods of the "Interpreter":

func (*Interpreter) ErrorFilter(filt func(error) error)
func (*Interpreter) Eval(args ...interface{}) error
func (*Interpreter) EvalAs(out interface{}, args ...interface{}) error
func (*Interpreter) Set(name string, val interface{}) error
func (*Interpreter) UploadImage(name string, img image.Image) error
func (*Interpreter) RegisterCommand(name string, cbfunc interface{}) error
func (*Interpreter) UnregisterCommand(name string) error
func (*Interpreter) RegisterCommands(name string, val interface{}) error
func (*Interpreter) UnregisterCommands(name string) error

As it was stated before, the "Interpreter" is being executed in a separate
goroutine and each method is completely thread-safe. Also every method is
synchronous. It will queue commands for execution and wait for their
completion.

That's it. See "examples" directory it has the use cases for most of the API.

More Repositories

1

gocode

An autocompletion daemon for the Go programming language
Go
5,006
star
2

termbox-go

Pure Go termbox implementation
Go
4,666
star
3

termbox

Library for writing text-based user interfaces
C
1,963
star
4

godit

A very religious text editor
Go
576
star
5

jsondiff

JsonDiff library
Go
210
star
6

gollvm

LLVM bindings for the Go programming language
Go
97
star
7

gotris

A classic tetris game written in Go programming language
Go
92
star
8

pnoise

Perlin noise benchmark
Lua
77
star
9

obkey

ObKey - Openbox Key Editor
Python
70
star
10

sseculling

SSE Frustum Culling Demo
C++
67
star
11

mc

A very simple marching cubes example.
C++
64
star
12

golemon

Port of the lemon parser generator to the Go programming language
C
55
star
13

gogobject

GObject-introspection based bindings generator
Go
47
star
14

krawl

Krawl programming language compiler
C++
42
star
15

gocovgui

A simple GUI wrapper for the gocov coverage analysis tool
Go
42
star
16

bmpanel2

bmpanel version 2
C
35
star
17

bin2go

Binary to Go source file converter
Go
24
star
18

ccode

An autocompletion daemon for the C programming language (vim, libclang, omnifunc)
C
23
star
19

imgui-rust

Alternative (personal) imgui rust bindings
Rust
20
star
20

sexp

S-expressions parser in the Go programming language
Go
19
star
21

nextgame

Work-in-progress "voxel" game or game engine.
C
18
star
22

bmpanel

bmpanel - lightweight, netwm compliant, x11 panel with desktop switcher, taskbar, systray and clock
C
17
star
23

tulib

Termbox Utilities Library
Go
14
star
24

libtorgo

BitTorrent Go library
Go
12
star
25

gortfm

Documentation generator for the Go programming language
Go
11
star
26

emacskeys

QtCreator plugin targeting emacs users
C++
11
star
27

gomandel

Go mandelbrot demo program
Go
9
star
28

sqlrace

SQL Race condition demo
Go
8
star
29

torgo

BitTorrent client and a tool written in Go
Go
8
star
30

ancient

A toy compiled programming language
C
8
star
31

interlua

C++11/Lua bindings generator
C++
6
star
32

vulkangen

Vulkan C++ wrapper generator
Go
6
star
33

vrmp

VR media player for linux
Rust
5
star
34

lib99

C
5
star
35

libzbs

Experimental C++11 cross-platform software utility library
C++
5
star
36

shebang

Shebang scripting language
Go
4
star
37

changedir

utility that helps you maintain visited directories history
Go
3
star
38

tbclock

tty-clock clone based on termbox
C
3
star
39

sqlbatch

WIP
Go
3
star
40

cppmandel

Multihreaded mandelbrot set renderer using experimental C++ coroutines.
C++
3
star
41

shell-util

Shell scripting helper functions for deno
TypeScript
3
star
42

sx

Sx file format
Go
3
star
43

goal

Go makefile templates system
Go
2
star
44

GodotSlerpTest

Just a test case
GDScript
2
star
45

jsondiff-demo

github.com/nsf/jsondiff demo
JavaScript
2
star
46

depsinfo

analyze dependencies and libraries of a deno script
TypeScript
1
star
47

packeter

Channel <-> network connection adapter library
Go
1
star