gtk

package
Version: v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2021 License: ISC Imports: 14 Imported by: 414

Documentation

Overview

Go bindings for GTK+ 3. Supports version 3.6 and later.

Functions use the same names as the native C function calls, but use CamelCase. In cases where native GTK uses pointers to values to simulate multiple return values, Go's native multiple return values are used instead. Whenever a native GTK call could return an unexpected NULL pointer, an additional error is returned in the Go binding.

GTK's C API documentation can be very useful for understanding how the functions in this package work and what each type is for. This documentation can be found at https://developer.gnome.org/gtk3/.

In addition to Go versions of the C GTK functions, every struct type includes a method named Native (either by direct implementation, or by means of struct embedding). These methods return a uintptr of the native C object the binding type represents. These pointers may be type switched to a native C pointer using unsafe and used with cgo function calls outside this package.

Memory management is handled in proper Go fashion, using runtime finalizers to properly free memory when it is no longer needed. Each time a Go type is created with a pointer to a GObject, a reference is added for Go, sinking the floating reference when necessary. After going out of scope and the next time Go's garbage collector is run, a finalizer is run to remove Go's reference to the GObject. When this reference count hits zero (when neither Go nor GTK holds ownership) the object will be freed internally by GTK.

Index

Constants

View Source
const (
	SORT_COLUMN_DEFAULT  int = -1
	SORT_COLUMN_UNSORTED int = -2
)

Use as column id in SetSortColumnId to specify ListStore sorted by default column or unsorted

View Source
const (
	STACK_TRANSITION_TYPE_OVER_UP      StackTransitionType = C.GTK_STACK_TRANSITION_TYPE_OVER_UP
	STACK_TRANSITION_TYPE_OVER_DOWN                        = C.GTK_STACK_TRANSITION_TYPE_OVER_DOWN
	STACK_TRANSITION_TYPE_OVER_LEFT                        = C.GTK_STACK_TRANSITION_TYPE_OVER_LEFT
	STACK_TRANSITION_TYPE_OVER_RIGHT                       = C.GTK_STACK_TRANSITION_TYPE_OVER_RIGHT
	STACK_TRANSITION_TYPE_UNDER_UP                         = C.GTK_STACK_TRANSITION_TYPE_UNDER_UP
	STACK_TRANSITION_TYPE_UNDER_DOWN                       = C.GTK_STACK_TRANSITION_TYPE_UNDER_DOWN
	STACK_TRANSITION_TYPE_UNDER_LEFT                       = C.GTK_STACK_TRANSITION_TYPE_UNDER_LEFT
	STACK_TRANSITION_TYPE_UNDER_RIGHT                      = C.GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT
	STACK_TRANSITION_TYPE_OVER_UP_DOWN                     = C.GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN
)
View Source
const (
	ICON_LOOKUP_FORCE_REGULAR  IconLookupFlags = C.GTK_ICON_LOOKUP_FORCE_REGULAR
	ICON_LOOKUP_FORCE_SYMBOLIC                 = C.GTK_ICON_LOOKUP_FORCE_SYMBOLIC
	ICON_LOOKUP_DIR_LTR                        = C.GTK_ICON_LOOKUP_DIR_LTR
	ICON_LOOKUP_DIR_RTL                        = C.GTK_ICON_LOOKUP_DIR_RTL
)

IconLookupFlags is a representation of GTK's GtkIconLookupFlags.

View Source
const (
	STACK_TRANSITION_TYPE_OVER_DOWN_UP    StackTransitionType = C.GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP
	STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT                     = C.GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT
	STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT                     = C.GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT
)
View Source
const (
	LEVEL_BAR_OFFSET_LOW  string = C.GTK_LEVEL_BAR_OFFSET_LOW
	LEVEL_BAR_OFFSET_HIGH string = C.GTK_LEVEL_BAR_OFFSET_HIGH
)

stock offset macro values of GtkLevelBar

View Source
const (
	UNIT_PIXEL           int    = C.GTK_UNIT_PIXEL
	PAPER_NAME_A3        string = C.GTK_PAPER_NAME_A3
	PAPER_NAME_A4        string = C.GTK_PAPER_NAME_A4
	PAPER_NAME_A5        string = C.GTK_PAPER_NAME_A5
	PAPER_NAME_B5        string = C.GTK_PAPER_NAME_B5
	PAPER_NAME_LETTER    string = C.GTK_PAPER_NAME_LETTER
	PAPER_NAME_EXECUTIVE string = C.GTK_PAPER_NAME_EXECUTIVE
	PAPER_NAME_LEGAL     string = C.GTK_PAPER_NAME_LEGAL
)
View Source
const (
	PRINT_SETTINGS_PRINTER              string = C.GTK_PRINT_SETTINGS_PRINTER
	PRINT_SETTINGS_ORIENTATION          string = C.GTK_PRINT_SETTINGS_ORIENTATION
	PRINT_SETTINGS_PAPER_FORMAT         string = C.GTK_PRINT_SETTINGS_PAPER_FORMAT
	PRINT_SETTINGS_PAPER_WIDTH          string = C.GTK_PRINT_SETTINGS_PAPER_WIDTH
	PRINT_SETTINGS_PAPER_HEIGHT         string = C.GTK_PRINT_SETTINGS_PAPER_HEIGHT
	PRINT_SETTINGS_USE_COLOR            string = C.GTK_PRINT_SETTINGS_USE_COLOR
	PRINT_SETTINGS_COLLATE              string = C.GTK_PRINT_SETTINGS_COLLATE
	PRINT_SETTINGS_REVERSE              string = C.GTK_PRINT_SETTINGS_REVERSE
	PRINT_SETTINGS_DUPLEX               string = C.GTK_PRINT_SETTINGS_DUPLEX
	PRINT_SETTINGS_QUALITY              string = C.GTK_PRINT_SETTINGS_QUALITY
	PRINT_SETTINGS_N_COPIES             string = C.GTK_PRINT_SETTINGS_N_COPIES
	PRINT_SETTINGS_NUMBER_UP            string = C.GTK_PRINT_SETTINGS_NUMBER_UP
	PRINT_SETTINGS_NUMBER_UP_LAYOUT     string = C.GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT
	PRINT_SETTINGS_RESOLUTION           string = C.GTK_PRINT_SETTINGS_RESOLUTION
	PRINT_SETTINGS_RESOLUTION_X         string = C.GTK_PRINT_SETTINGS_RESOLUTION_X
	PRINT_SETTINGS_RESOLUTION_Y         string = C.GTK_PRINT_SETTINGS_RESOLUTION_Y
	PRINT_SETTINGS_PRINTER_LPI          string = C.GTK_PRINT_SETTINGS_PRINTER_LPI
	PRINT_SETTINGS_SCALE                string = C.GTK_PRINT_SETTINGS_SCALE
	PRINT_SETTINGS_PRINT_PAGES          string = C.GTK_PRINT_SETTINGS_PRINT_PAGES
	PRINT_SETTINGS_PAGE_RANGES          string = C.GTK_PRINT_SETTINGS_PAGE_RANGES
	PRINT_SETTINGS_PAGE_SET             string = C.GTK_PRINT_SETTINGS_PAGE_SET
	PRINT_SETTINGS_DEFAULT_SOURCE       string = C.GTK_PRINT_SETTINGS_DEFAULT_SOURCE
	PRINT_SETTINGS_MEDIA_TYPE           string = C.GTK_PRINT_SETTINGS_MEDIA_TYPE
	PRINT_SETTINGS_DITHER               string = C.GTK_PRINT_SETTINGS_DITHER
	PRINT_SETTINGS_FINISHINGS           string = C.GTK_PRINT_SETTINGS_FINISHINGS
	PRINT_SETTINGS_OUTPUT_BIN           string = C.GTK_PRINT_SETTINGS_OUTPUT_BIN
	PRINT_SETTINGS_OUTPUT_DIR           string = C.GTK_PRINT_SETTINGS_OUTPUT_DIR
	PRINT_SETTINGS_OUTPUT_BASENAME      string = C.GTK_PRINT_SETTINGS_OUTPUT_BASENAME
	PRINT_SETTINGS_OUTPUT_FILE_FORMAT   string = C.GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT
	PRINT_SETTINGS_OUTPUT_URI           string = C.GTK_PRINT_SETTINGS_OUTPUT_URI
	PRINT_SETTINGS_WIN32_DRIVER_EXTRA   string = C.GTK_PRINT_SETTINGS_WIN32_DRIVER_EXTRA
	PRINT_SETTINGS_WIN32_DRIVER_VERSION string = C.GTK_PRINT_SETTINGS_WIN32_DRIVER_VERSION
)
View Source
const (
	STYLE_PROVIDER_PRIORITY_FALLBACK    StyleProviderPriority = C.GTK_STYLE_PROVIDER_PRIORITY_FALLBACK
	STYLE_PROVIDER_PRIORITY_THEME                             = C.GTK_STYLE_PROVIDER_PRIORITY_THEME
	STYLE_PROVIDER_PRIORITY_SETTINGS                          = C.GTK_STYLE_PROVIDER_PRIORITY_SETTINGS
	STYLE_PROVIDER_PRIORITY_APPLICATION                       = C.GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
	STYLE_PROVIDER_PRIORITY_USER                              = C.GTK_STYLE_PROVIDER_PRIORITY_USER
)
View Source
const (
	TREE_VIEW_COLUMN_GROW_ONLY TreeViewColumnSizing = C.GTK_TREE_VIEW_COLUMN_GROW_ONLY
	TREE_VIEW_COLUMN_AUTOSIZE                       = C.GTK_TREE_VIEW_COLUMN_AUTOSIZE
	TREE_VIEW_COLUMN_FIXED                          = C.GTK_TREE_VIEW_COLUMN_FIXED
)
View Source
const (
	LEVEL_BAR_OFFSET_FULL string = C.GTK_LEVEL_BAR_OFFSET_FULL
)

Variables

View Source
var WrapMap = map[string]WrapFn{
	"GtkAccelGroup":           wrapAccelGroup,
	"GtkAccelMao":             wrapAccelMap,
	"GtkAdjustment":           wrapAdjustment,
	"GtkApplicationWindow":    wrapApplicationWindow,
	"GtkAssistant":            wrapAssistant,
	"GtkBin":                  wrapBin,
	"GtkBox":                  wrapBox,
	"GtkButton":               wrapButton,
	"GtkButtonBox":            wrapButtonBox,
	"GtkCalendar":             wrapCalendar,
	"GtkCellLayout":           wrapCellLayout,
	"GtkCellEditable":         wrapCellEditable,
	"GtkCellRenderer":         wrapCellRenderer,
	"GtkCellRendererSpinner":  wrapCellRendererSpinner,
	"GtkCellRendererPixbuf":   wrapCellRendererPixbuf,
	"GtkCellRendererText":     wrapCellRendererText,
	"GtkCellRendererProgress": wrapCellRendererProgress,
	"GtkCellRendererToggle":   wrapCellRendererToggle,
	"GtkCellRendererCombo":    wrapCellRendererCombo,
	"GtkCellRendererAccel":    wrapCellRendererAccel,
	"GtkCellRendererSpin":     wrapCellRendererSpin,
	"GtkCheckButton":          wrapCheckButton,
	"GtkCheckMenuItem":        wrapCheckMenuItem,
	"GtkClipboard":            wrapClipboard,
	"GtkColorButton":          wrapColorButton,
	"GtkContainer":            wrapContainer,
	"GtkDialog":               wrapDialog,
	"GtkDrawingArea":          wrapDrawingArea,
	"GtkEditable":             wrapEditable,
	"GtkEntry":                wrapEntry,
	"GtkEntryBuffer":          wrapEntryBuffer,
	"GtkEntryCompletion":      wrapEntryCompletion,
	"GtkEventBox":             wrapEventBox,
	"GtkExpander":             wrapExpander,
	"GtkFrame":                wrapFrame,
	"GtkFileChooser":          wrapFileChooser,
	"GtkFileChooserButton":    wrapFileChooserButton,
	"GtkFileChooserDialog":    wrapFileChooserDialog,
	"GtkFileChooserWidget":    wrapFileChooserWidget,
	"GtkGrid":                 wrapGrid,
	"GtkIconView":             wrapIconView,
	"GtkImage":                wrapImage,
	"GtkLabel":                wrapLabel,
	"GtkLayout":               wrapLayout,
	"GtkLinkButton":           wrapLinkButton,
	"GtkListStore":            wrapListStore,
	"GtkMenu":                 wrapMenu,
	"GtkMenuBar":              wrapMenuBar,
	"GtkMenuButton":           wrapMenuButton,
	"GtkMenuItem":             wrapMenuItem,
	"GtkMenuShell":            wrapMenuShell,
	"GtkMessageDialog":        wrapMessageDialog,
	"GtkNotebook":             wrapNotebook,
	"GtkOffscreenWindow":      wrapOffscreenWindow,
	"GtkOrientable":           wrapOrientable,
	"GtkOverlay":              wrapOverlay,
	"GtkPaned":                wrapPaned,
	"GtkProgressBar":          wrapProgressBar,
	"GtkRadioButton":          wrapRadioButton,
	"GtkRadioMenuItem":        wrapRadioMenuItem,
	"GtkRange":                wrapRange,
	"GtkRecentChooser":        wrapRecentChooser,
	"GtkRecentChooserMenu":    wrapRecentChooserMenu,
	"GtkRecentFilter":         wrapRecentFilter,
	"GtkRecentManager":        wrapRecentManager,
	"GtkScaleButton":          wrapScaleButton,
	"GtkScale":                wrapScale,
	"GtkScrollable":           wrapScrollable,
	"GtkScrollbar":            wrapScrollbar,
	"GtkScrolledWindow":       wrapScrolledWindow,
	"GtkSearchEntry":          wrapSearchEntry,
	"GtkSeparator":            wrapSeparator,
	"GtkSeparatorMenuItem":    wrapSeparatorMenuItem,
	"GtkSeparatorToolItem":    wrapSeparatorToolItem,
	"GtkSpinButton":           wrapSpinButton,
	"GtkSpinner":              wrapSpinner,
	"GtkStatusbar":            wrapStatusbar,
	"GtkSwitch":               wrapSwitch,
	"GtkTextBuffer":           wrapTextBuffer,
	"GtkTextChildAnchor":      wrapTextChildAnchor,
	"GtkTextTag":              wrapTextTag,
	"GtkTextTagTable":         wrapTextTagTable,
	"GtkTextView":             wrapTextView,
	"GtkToggleButton":         wrapToggleButton,
	"GtkToolbar":              wrapToolbar,
	"GtkToolButton":           wrapToolButton,
	"GtkToggleToolButton":     wrapToggleToolButton,
	"GtkToolItem":             wrapToolItem,
	"GtkTreeModel":            wrapTreeModel,
	"GtkTreeModelFilter":      wrapTreeModelFilter,
	"GtkTreeModelSort":        wrapTreeModelSort,
	"GtkTreeSelection":        wrapTreeSelection,
	"GtkTreeStore":            wrapTreeStore,
	"GtkTreeView":             wrapTreeView,
	"GtkTreeViewColumn":       wrapTreeViewColumn,
	"GtkViewport":             wrapViewport,
	"GtkVolumeButton":         wrapVolumeButton,
	"GtkWidget":               wrapWidget,
	"GtkWindow":               wrapWindow,
}

Functions

func AccelGroupsActivate

func AccelGroupsActivate(obj *glib.Object, key uint, mods gdk.ModifierType) bool

AccelGroupsActivate is a wrapper around gtk_accel_groups_activate().

func AccelGroupsFromObject

func AccelGroupsFromObject(obj *glib.Object) *glib.SList

AccelGroupsFromObject is a wrapper around gtk_accel_groups_from_object().

func AccelMapAddEntry

func AccelMapAddEntry(path string, key uint, mods gdk.ModifierType)

AccelMapAddEntry is a wrapper around gtk_accel_map_add_entry().

func AccelMapAddFilter

func AccelMapAddFilter(filter string)

AccelMapAddFilter is a wrapper around gtk_accel_map_add_filter().

func AccelMapChangeEntry

func AccelMapChangeEntry(path string, key uint, mods gdk.ModifierType, replace bool) bool

AccelMapChangeEntry is a wrapper around gtk_accel_map_change_entry().

func AccelMapLoad

func AccelMapLoad(fileName string)

AccelMapLoad is a wrapper around gtk_accel_map_load().

func AccelMapLoadFD

func AccelMapLoadFD(fd int)

AccelMapLoadFD is a wrapper around gtk_accel_map_load_fd().

func AccelMapLockPath

func AccelMapLockPath(path string)

AccelMapLockPath is a wrapper around gtk_accel_map_lock_path().

func AccelMapSave

func AccelMapSave(fileName string)

AccelMapSave is a wrapper around gtk_accel_map_save().

func AccelMapSaveFD

func AccelMapSaveFD(fd int)

AccelMapSaveFD is a wrapper around gtk_accel_map_save_fd().

func AccelMapUnlockPath

func AccelMapUnlockPath(path string)

AccelMapUnlockPath is a wrapper around gtk_accel_map_unlock_path().

func AcceleratorGetDefaultModMask

func AcceleratorGetDefaultModMask() gdk.ModifierType

AcceleratorGetDefaultModMask is a wrapper around gtk_accelerator_get_default_mod_mask().

func AcceleratorGetLabel

func AcceleratorGetLabel(key uint, mods gdk.ModifierType) string

AcceleratorGetLabel is a wrapper around gtk_accelerator_get_label().

func AcceleratorName

func AcceleratorName(key uint, mods gdk.ModifierType) string

AcceleratorName is a wrapper around gtk_accelerator_name().

func AcceleratorParse

func AcceleratorParse(acc string) (key uint, mods gdk.ModifierType)

AcceleratorParse is a wrapper around gtk_accelerator_parse().

func