gtk

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GdkButton

func GdkButton(event *GdkEventButton) (int, int, int, int)

GdkButton returns mouse button type, button id, x, y of mouse event

func GdkConfigure

func GdkConfigure(allocation *GtkAllocation, top *TopWindow) (int, int, int, int)

GdkConfigure returns application width, height and inner rectange width, height

func GdkKey

func GdkKey(event *GdkEventKey) (rune, bool, bool, bool, bool, string)

GdkKey returns key rune, shift, control, alt, meta statuses and key name

func GdkMotion

func GdkMotion(event *GdkEventMotion) (int, int, bool, bool, bool, bool)

GdkMotion returns x, y of mouse motion event, shift, control, alt, meta statuses

func GdkScroll

func GdkScroll(event *GdkEventScroll) (int, int, int)

GdkScroll returns scroll direction, deltaX, deltaY of scroll event

func NotifyWeakRef

func NotifyWeakRef(object *C.GObject, callback func(data uintptr), data uintptr)

NotifyWeakRef connects a callback for weak notify

func RequestClipboardText

func RequestClipboardText(callback func(text string))

RequestClipboardText connects a callback for clipboard receiving

func SetClipboardText

func SetClipboardText(text string)

SetClipboardText sets clipboard content

func SignalDrawCallback

func SignalDrawCallback(callback func(cr *Cairo, h *cgo.Handle))

SignalDrawCallback connects a callback for "draw" event

func SignalMenuItemActivateCallback

func SignalMenuItemActivateCallback(callback func(h *cgo.Handle))

SignalMenuItemActivateCallback connects a callback for "activate" event

Types

type Application

type Application struct {
	// contains filtered or unexported fields
}

Application is a GtkApplication wrapper

func NewApplication

func NewApplication() *Application

NewApplication creates Application

func (*Application) GActionMap

func (app *Application) GActionMap() *C.GActionMap

GActionMap returns C.GActionMap type pointer

func (*Application) GApplication

func (app *Application) GApplication() *C.GApplication

GApplication returns C.GApplication type pointer

func (*Application) GObject

func (app *Application) GObject() *C.GObject

GObject returns C.GObject pointer

func (*Application) GPointer

func (app *Application) GPointer() C.gpointer

GPointer returns C.gpointer address

func (*Application) GtkApplication

func (app *Application) GtkApplication() *C.GtkApplication

GtkApplication returns C.GtkApplication pointer

func (*Application) NewMenu

func (app *Application) NewMenu() *Menu

NewMenu creates application menu

func (*Application) NewMenuAction

func (app *Application) NewMenuAction(action string) *MenuAction

NewMenuAction creates a new menu action

func (*Application) NewTopWindow added in v0.4.6

func (app *Application) NewTopWindow() *TopWindow

NewTopWindow creates a WindowWidget

func (*Application) Quit

func (app *Application) Quit()

Quit quits application

func (*Application) Run

func (app *Application) Run()

Run runs application

func (*Application) SetName

func (app *Application) SetName(name string)

SetName sets application name

func (*Application) SignalActivate

func (app *Application) SignalActivate(callback func())

SignalActivate connects a callback for "activate" event

func (*Application) SignalShutdown

func (app *Application) SignalShutdown(callback func())

SignalShutdown connects a callback for "shutdown" event

func (*Application) SignalStartup added in v0.4.6

func (app *Application) SignalStartup(callback func())

SignalStartup connects a callback for "startup" event

type Cairo

type Cairo C.cairo_t

Cairo is a cairo_t wrapper

type CairoBitmap

type CairoBitmap struct {
	// contains filtered or unexported fields
}

CairoBitmap is a cairo_surface_t wrapper

func NewCairoBitmap

func NewCairoBitmap(data []byte, width, height int) *CairoBitmap

NewCairoBitmap returns a CairoBitmap from a image bitmap

func (*CairoBitmap) Destroy

func (e *CairoBitmap) Destroy()

Destroy destroys image bitmap buffers

type CairoFillPaint

type CairoFillPaint struct {
	// contains filtered or unexported fields
}

CairoFillPaint is a fill element parameters

func NewCairoFillPaint

func NewCairoFillPaint(x, y, width, height int, r, g, b, a uint16) *CairoFillPaint

NewCairoFillPaint returns a fill element parameters

func (*CairoFillPaint) Paint

func (e *CairoFillPaint) Paint(c *Cairo)

Paint paints current element

type CairoImagePaint

type CairoImagePaint struct {
	// contains filtered or unexported fields
}

CairoImagePaint is a image element parameters

func NewCairoImagePaint

func NewCairoImagePaint(x, y, width, height int, image *CairoBitmap) *CairoImagePaint

NewCairoImagePaint returns a image element parameters

func (*CairoImagePaint) Paint

func (e *CairoImagePaint) Paint(c *Cairo)

Paint paints current element

type CairoLinePaint

type CairoLinePaint struct {
	// contains filtered or unexported fields
}

CairoLinePaint is a line element parameters

func NewCairoLinePaint

func NewCairoLinePaint(x0, y0, x1, y1 int, r, g, b, a uint16) *CairoLinePaint

NewCairoLinePaint returns a line element parameters

func (*CairoLinePaint) Paint

func (e *CairoLinePaint) Paint(c *Cairo)

Paint paints current element

type CairoTextPaint

type CairoTextPaint struct {
	// contains filtered or unexported fields
}

CairoTextPaint is a text element parameters

func NewCairoTextPaint

func NewCairoTextPaint(x, y int, r, g, b, a uint16, font *FontSelection, text string) *CairoTextPaint

NewCairoTextPaint returns a text element parameters

func (*CairoTextPaint) Destroy

func (e *CairoTextPaint) Destroy()

Destroy destroys current element

func (*CairoTextPaint) Paint

func (e *CairoTextPaint) Paint(c *Cairo)

Paint paints current element

type Drawing added in v0.4.6

type Drawing struct {
	// contains filtered or unexported fields
}

Drawing contains DrawingArea widget

func (*Drawing) Destroy added in v0.4.6

func (drawing *Drawing) Destroy()

Destroy destroys widget

func (*Drawing) Move added in v0.4.6

func (drawing *Drawing) Move(x, y int)

Move shifts widget to a new coordinates

func (*Drawing) QueueDraw added in v0.4.6

func (drawing *Drawing) QueueDraw()

QueueDraw marks a widget to redrawing

func (*Drawing) Raise added in v0.4.6

func (drawing *Drawing) Raise()

Raise raises widget

func (*Drawing) Show added in v0.4.6

func (drawing *Drawing) Show()

Show shows widget

func (*Drawing) SignalDraw added in v0.4.6

func (drawing *Drawing) SignalDraw(h *cgo.Handle)

SignalDraw connects a callback parameters for "draw" event

func (*Drawing) Size added in v0.4.6

func (drawing *Drawing) Size(width, height int)

Size resizes widget size

func (*Drawing) Widget added in v0.4.6

func (drawing *Drawing) Widget() *Widget

Widget returns a Widget pointer

type Fixed added in v0.4.6

type Fixed struct {
	// contains filtered or unexported fields
}

type Fixed contains GtkFixed widget

func (*Fixed) Destroy added in v0.4.6

func (fixed *Fixed) Destroy()

Destroy destroys widget

func (*Fixed) Move added in v0.4.6

func (fixed *Fixed) Move(x, y int)

Move shifts widget to a new coordinates

func (*Fixed) NewDrawingArea added in v0.4.6

func (fixed *Fixed) NewDrawingArea() *Drawing

NewDrawingArea creates a DrawingWidget child

func (*Fixed) NewFixed added in v0.4.6

func (fixed *Fixed) NewFixed() *Fixed

NewFixed creates a FixedWidget child

func (*Fixed) Raise added in v0.4.6

func (fixed *Fixed) Raise()

Raise raises widget

func (*Fixed) Show added in v0.4.6

func (fixed *Fixed) Show()

Show shows widget

func (*Fixed) Size added in v0.4.6

func (fixed *Fixed) Size(width, height int)

Size resizes widget size

func (*Fixed) Widget added in v0.4.6

func (fixed *Fixed) Widget() *Widget

Widget returns a Widget pointer

type FontSelection

type FontSelection struct {
	// contains filtered or unexported fields
}

FontSelection is a PangoFontDescription wrapper

func NewFontSelection

func NewFontSelection(height int, family string, style int, variant int, weight int, stretch int) *FontSelection

NewFontSelection creates FontSelection

func (*FontSelection) Free

func (f *FontSelection) Free()

Free destroys font selection

func (*FontSelection) Metrics

func (f *FontSelection) Metrics(top *TopWindow) (int, int, int, int)

Metrics returns font selection lineheight, baseline, ascent, descent

func (*FontSelection) Size

func (f *FontSelection) Size(top *TopWindow, text string) (int, int)

Size returns text string width and height in pixels

func (*FontSelection) Split

func (f *FontSelection) Split(top *TopWindow, text string, edge, indent int) []int

Split splits text string to substrings

type GdkEventButton

type GdkEventButton C.GdkEventButton

GdkEventButton is a GdkEventButton wrapper

type GdkEventKey

type GdkEventKey C.GdkEventKey

GdkEventKey is a GdkEventKey wrapper

type GdkEventMotion

type GdkEventMotion C.GdkEventMotion

GdkEventMotion is a GdkEventMotion wrapper

type GdkEventScroll

type GdkEventScroll C.GdkEventScroll

GdkEventScroll is a GdkEventScroll wrapper

type GtkAllocation added in v0.4.6

type GtkAllocation C.GtkAllocation

GtkAllocation ia a GtkAllocation wrapper

type Layout added in v0.4.6

type Layout struct {
	// contains filtered or unexported fields
}

Layout contains GtkLayout widget

func (*Layout) Destroy added in v0.4.6

func (layout *Layout) Destroy()

Destroy destroys widget

func (*Layout) Move added in v0.4.6

func (layout *Layout) Move(x, y int)

Move is a empty method

func (*Layout) NewDrawingArea added in v0.4.6

func (layout *Layout) NewDrawingArea() *Drawing

NewDrawingArea creates a DrawingWidget child

func (*Layout) NewFixed added in v0.4.6

func (layout *Layout) NewFixed() *Fixed

NewFixed creates a FixedWidget child

func (*Layout) Raise added in v0.4.6

func (layout *Layout) Raise()

Raise is a empty method

func (*Layout) Show added in v0.4.6

func (layout *Layout) Show()

Show shows widget

func (*Layout) SignalSizeAllocate added in v0.4.6

func (layout *Layout) SignalSizeAllocate(callback func(allocation *GtkAllocation))

SignalSizeAllocate connects a callback for "size-allocate" event

func (*Layout) Size added in v0.4.6

func (layout *Layout) Size(width, height int)

Size resizes widget size

func (*Layout) Widget added in v0.4.6

func (layout *Layout) Widget() *Widget

Widget returns a Widget pointer

type Menu struct {
	// contains filtered or unexported fields
}

Menu is a GMenu wrapper

func (menu *Menu) Destroy()

Destroy destroys application menu

func (parent *Menu) NewNode(label string) *MenuNode

NewNode creates new submenu node with label

type MenuAction struct {
	// contains filtered or unexported fields
}

MenuAction is a GSimpleAction wrapper

func (action *MenuAction) Destroy()

Destroy destroys menu action

func (action *MenuAction) GObject() *C.GObject

GObject returns C.GObject pointer

func (action *MenuAction) SignalMenuItemActivate(h *cgo.Handle)

SignalMenuItemActivate connects a callback parameters for "activate" event

type MenuItem struct {
	// contains filtered or unexported fields
}

MenuItem is a GMenuItem wrapper

func (item *MenuItem) Destroy()

Destroy destroys menu item

type MenuNode struct {
	*Menu
	// contains filtered or unexported fields
}

MenuNode represents menu node

func (menu *MenuNode) Destroy()

Destroy destroys submenu node

func (node *MenuNode) NewItem(label string, action string) *MenuItem

NewItem adds menu item with label and action to submenu

type TopWindow added in v0.4.6

type TopWindow struct {
	// contains filtered or unexported fields
}

type TopWindow contains GtkWindow widget

func (*TopWindow) Destroy added in v0.4.6

func (window *TopWindow) Destroy()

Destroy destroys widget

func (*TopWindow) NewLayout added in v0.4.6

func (window *TopWindow) NewLayout() *Layout

NewLayout creates a LayoutWidget

func (*TopWindow) ShowAll added in v0.4.6

func (window *TopWindow) ShowAll()

ShowAll shows a window with all child widgets

func (*TopWindow) Size added in v0.4.6

func (window *TopWindow) Size(x, y, width, height int)

Size move and resize application window

func (*TopWindow) Widget added in v0.4.6

func (window *TopWindow) Widget() *Widget

Widget returns a Widget pointer

type WatchIO

type WatchIO struct {
	// contains filtered or unexported fields
}

WatchIO is a channel watch IDs

func NewRequestIO

func NewRequestIO(syncFile fder, readFn func()) (*WatchIO, error)

NewRequestIO returns a watchers for full duplex pipe

func NewStreamIO

func NewStreamIO(streamFile fder, readFn func()) (*WatchIO, error)

NewStreamIO returns a watchers for async pipe

func (*WatchIO) Done

func (w *WatchIO) Done()

Done removes channel watchers

type Widget

type Widget struct {
	// contains filtered or unexported fields
}

Widget is a GtkWidget wrapper

func (*Widget) GObject

func (widget *Widget) GObject() *C.GObject

GObject returns C.GObject pointer from widget

func (*Widget) GtkWidget added in v0.4.6

func (widget *Widget) GtkWidget() *C.GtkWidget

GtkWidget returns C.GtkWidget pointer

func (*Widget) SignalButtonPress

func (widget *Widget) SignalButtonPress(callback func(event *GdkEventButton))

SignalButtonPress connects a callback for "button_press_event" event

func (*Widget) SignalButtonRelease

func (widget *Widget) SignalButtonRelease(callback func(event *GdkEventButton))

SignalButtonRelease connects a callback for "button_release_event" event

func (*Widget) SignalDelete

func (widget *Widget) SignalDelete(callback func())

SignalDelete connects a callback for "delete-event" event

func (*Widget) SignalKeyPress

func (widget *Widget) SignalKeyPress(callback func(event *GdkEventKey))

SignalKeyPress connects a callback for "key_press_event" event

func (*Widget) SignalMotionNotify

func (widget *Widget) SignalMotionNotify(callback func(event *GdkEventMotion))

SignalMotionNotify connects a callback for "motion_notify_event" event

func (*Widget) SignalScroll

func (widget *Widget) SignalScroll(callback func(event *GdkEventScroll))

SignalScroll connects a callback for "scroll-event" event

Jump to

Keyboard shortcuts

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