gtk

package module
v0.0.0-...-709c6d2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2013 License: BSD-3-Clause Imports: 5 Imported by: 7

README

Example Go bindings for GTK.

This is only example of usage of the glib package to build bindings for GTK. It isn't suitable for writing real applications. If you need working GTK binding see go-gtk or fork this project and write missing features.

See examples directory to find out what my approach is different from the go-gtk.

Dependencies

You need gtk 2.0 library with C header files to install this package (libgtk2.0-dev on Debian/Ubuntu).

Documentation

Index

Constants

View Source
const (
	FILE_CHOOSER_ACTION_OPEN          = FileChooserAction(C.GTK_FILE_CHOOSER_ACTION_OPEN)
	FILE_CHOOSER_ACTION_SAVE          = FileChooserAction(C.GTK_FILE_CHOOSER_ACTION_SAVE)
	FILE_CHOOSER_ACTION_SELECT_FOLDER = FileChooserAction(C.GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
	FILE_CHOOSER_ACTION_CREATE_FOLDER = FileChooserAction(C.GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
)
View Source
const (
	WINDOW_TOPLEVEL = WindowType(C.GTK_WINDOW_TOPLEVEL)
	WINDOW_POPUP    = WindowType(C.GTK_WINDOW_POPUP)
)

Variables

This section is empty.

Functions

func Main

func Main()

func MainQuit

func MainQuit()

Types

type Bin

type Bin struct {
	Container
}

func (*Bin) AsBin

func (b *Bin) AsBin() *Bin

func (*Bin) GetChild

func (b *Bin) GetChild() *Widget

type Box

type Box struct {
	Container
}

func (*Box) AsBox

func (b *Box) AsBox() *Box

func (*Box) GetSpecing

func (b *Box) GetSpecing() int

func (*Box) PackEnd

func (b *Box) PackEnd(child *Widget, expand, fill bool, padding uint)

func (*Box) PackStart

func (b *Box) PackStart(child *Widget, expand, fill bool, padding uint)

func (*Box) SetSpecing

func (b *Box) SetSpecing(spacing int)

type Button

type Button struct {
	Bin
}

func NewButton

func NewButton() *Button

func NewButtonFromStock

func NewButtonFromStock(stock string) *Button

func NewButtonWithLabel

func NewButtonWithLabel(label string) *Button

func (*Button) AsButton

func (b *Button) AsButton() *Button

func (*Button) GetLabel

func (b *Button) GetLabel() string

func (*Button) GetUseStock

func (b *Button) GetUseStock() bool

func (*Button) SetLabel

func (b *Button) SetLabel(label string)

func (*Button) SetUseStock

func (b *Button) SetUseStock(use_stock bool)

type Container

type Container struct {
	Widget
}

func (*Container) Add

func (k *Container) Add(w *Widget)

func (*Container) AsContainer

func (k *Container) AsContainer() *Container

func (*Container) SetBorderWidth

func (k *Container) SetBorderWidth(width uint)

type DrawingArea

type DrawingArea struct {
	Widget
}

func NewDrawingArea

func NewDrawingArea() *DrawingArea

func (*DrawingArea) AsDrawingArea

func (d *DrawingArea) AsDrawingArea() *DrawingArea

type Entry

type Entry struct {
	Widget
}

func NewEntry

func NewEntry() *Entry

func (*Entry) AsEntry

func (e *Entry) AsEntry() *Entry

func (*Entry) GetText

func (e *Entry) GetText() string

func (*Entry) SetMaxLength

func (e *Entry) SetMaxLength(max int)

type FileChooser

type FileChooser C.GtkFileChooser

func FileChooserCast

func FileChooserCast(w *Widget) *FileChooser

func (*FileChooser) GetAction

func (f *FileChooser) GetAction() FileChooserAction

func (*FileChooser) GetFilename

func (f *FileChooser) GetFilename() string

func (*FileChooser) SetAction

func (f *FileChooser) SetAction(action FileChooserAction)

func (*FileChooser) Type

func (f *FileChooser) Type() glib.Type

type FileChooserAction

type FileChooserAction C.GtkFileChooserAction

type FileChooserButton

type FileChooserButton struct {
	HBox
}

func NewFileChooserButton

func NewFileChooserButton(title string, action FileChooserAction) *FileChooserButton

func (*FileChooserButton) AsFileChooserButton

func (f *FileChooserButton) AsFileChooserButton() *FileChooserButton

type HBox

type HBox struct {
	Box
}

func NewHBox

func NewHBox(homogeneous bool, spacing int) *HBox

func (*HBox) AsHBox

func (b *HBox) AsHBox() *HBox

type Settings

type Settings struct {
	glib.Object
}

func (*Settings) AsSettings

func (s *Settings) AsSettings() *Settings

func (*Settings) Set

func (s *Settings) Set(name string, val interface{})

type VBox

type VBox struct {
	Box
}

func NewVBox

func NewVBox(homogeneous bool, spacing int) *VBox

func (*VBox) AsVBox

func (b *VBox) AsVBox() *VBox

type Widget

type Widget struct {
	glib.Object
}

func (*Widget) AsWidget

func (w *Widget) AsWidget() *Widget

func (*Widget) Destroy

func (w *Widget) Destroy()

func (*Widget) GetSettings

func (w *Widget) GetSettings() *Settings

func (*Widget) GetWindow

func (w *Widget) GetWindow() *gdk.Window

func (*Widget) Hide

func (w *Widget) Hide()

func (*Widget) HideAll

func (w *Widget) HideAll()

func (*Widget) Realize

func (w *Widget) Realize()

func (*Widget) SetDoubleBuffered

func (w *Widget) SetDoubleBuffered(double_buffered bool)

func (*Widget) SetSizeRequest

func (w *Widget) SetSizeRequest(width, height int)

func (*Widget) Show

func (w *Widget) Show()

func (*Widget) ShowAll

func (w *Widget) ShowAll()

func (*Widget) ShowNow

func (w *Widget) ShowNow()

type Window

type Window struct {
	Bin
}

func NewWindow

func NewWindow(t WindowType) *Window

Returns C pointer

func (*Window) AsWindow

func (w *Window) AsWindow() *Window

func (*Window) SetDefaultSize

func (w *Window) SetDefaultSize(width, height int)

func (*Window) SetTitle

func (w *Window) SetTitle(title string)

type WindowType

type WindowType C.GtkWindowType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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