vtk

package module
v0.0.0-...-6016eac Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

README

vtk-go

vtk-go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Success            error = nil
	AllocationFailed         = errors.New("Allocation failed")
	NoSuitableVisual         = errors.New("Could not find TrueColor visual for X display")
	XOpenDisplayFailed       = errors.New("Opening X display failed")
	UnknownError             = errors.New("Unknown error")
)

Functions

func HasMod

func HasMod(e EventWithModifiers, m Modifier) bool

Types

type Event

type Event interface {
	Type() EventType
}

type EventWithModifiers

type EventWithModifiers interface {
	Mods() Modifier
}

type Key

type Key C.vtk_key
const (
	Backspace Key = C.VTK_K_BACKSPACE
	Tab       Key = C.VTK_K_TAB
	Return    Key = C.VTK_K_RETURN
	Escape    Key = C.VTK_K_ESCAPE
	Space     Key = C.VTK_K_SPACE
	Delete    Key = C.VTK_K_DELETE
	Insert    Key = C.VTK_K_INSERT

	PageUp   Key = C.VTK_K_PAGE_UP
	PageDown Key = C.VTK_K_PAGE_DOWN
	Home     Key = C.VTK_K_HOME
	End      Key = C.VTK_K_END
	Up       Key = C.VTK_K_UP
	Down     Key = C.VTK_K_DOWN
	Left     Key = C.VTK_K_LEFT
	Right    Key = C.VTK_K_RIGHT
)

func KeyFromString

func KeyFromString(s string) Key

type KeyEvent

type KeyEvent C.struct_vtk_key_event

func (KeyEvent) Key

func (k KeyEvent) Key() Key

func (KeyEvent) Mods

func (k KeyEvent) Mods() Modifier

func (KeyEvent) Type

func (k KeyEvent) Type() EventType

type Modifier

type Modifier C.vtk_modifiers
const (
	Shift    Modifier = C.VTK_M_SHIFT
	CapsLock Modifier = C.VTK_M_CAPS_LOCK
	Control  Modifier = C.VTK_M_CONTROL
	Alt      Modifier = C.VTK_M_ALT
	Super    Modifier = C.VTK_M_SUPER

	LeftButton   Modifier = C.VTK_M_LEFT_BTN
	MiddleButton Modifier = C.VTK_M_MIDDLE_BTN
	RightButton  Modifier = C.VTK_M_RIGHT_BTN
)

func ModifierFromString

func ModifierFromString(s string) Modifier

type MouseButtonEvent

type MouseButtonEvent C.struct_vtk_mouse_button_event

func (MouseButtonEvent) Btn

func (b MouseButtonEvent) Btn() Modifier

func (MouseButtonEvent) Mods

func (b MouseButtonEvent) Mods() Modifier

func (MouseButtonEvent) Pos

func (m MouseButtonEvent) Pos() (x, y int)

func (MouseButtonEvent) Type

func (b MouseButtonEvent) Type() EventType

type MouseMoveEvent

type MouseMoveEvent C.struct_vtk_mouse_move_event

func (MouseMoveEvent) Mods

func (m MouseMoveEvent) Mods() Modifier

func (MouseMoveEvent) Pos

func (m MouseMoveEvent) Pos() (x, y int)

func (MouseMoveEvent) Type

func (m MouseMoveEvent) Type() EventType

type Root

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

func New

func New() (Root, error)

func (Root) Destroy

func (root Root) Destroy()

func (Root) NewWindow

func (root Root) NewWindow(title string, x, y, w, h int) (Window, error)

type ScrollEvent

type ScrollEvent C.struct_vtk_scroll_event

func (ScrollEvent) Amount

func (s ScrollEvent) Amount() float64

func (ScrollEvent) Type

func (s ScrollEvent) Type() EventType

type Window

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

func (Window) Cairo

func (win Window) Cairo() cairo.Cairo

func (Window) Close

func (win Window) Close()

func (Window) Destroy

func (win Window) Destroy()

func (Window) Mainloop

func (win Window) Mainloop()

func (Window) Redraw

func (win Window) Redraw()

func (Window) SetEventHandler

func (win Window) SetEventHandler(t EventType, cb func(Event))

func (Window) SetTitle

func (win Window) SetTitle(title string)

func (Window) Size

func (win Window) Size() (width, height int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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