iggo

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2019 License: MIT Imports: 7 Imported by: 0

README

IGGO

Interface Grafica para Go (IGGO) está em desenvolvimento, na fase inicial do projeto.

Documentation

Index

Constants

View Source
const DefaltEnvironmentName = ixgb.BackendName

Variables

This section is empty.

Functions

func Use

func Use(name string) error

Use set the environment provider to be used when create a new environment.

Types

type Application

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

Application holds the windows

func NewApplication

func NewApplication() *Application

NewApplication creates a new application with default environment as backend.

func NewApplicationWithEnvironment

func NewApplicationWithEnvironment(env backend.Environment) *Application

NewApplicationWithEnvironment creates a new application with given environment as backend.

func (*Application) AddWindow

func (app *Application) AddWindow(w *Window)

func (*Application) Run

func (app *Application) Run() error

Run the application.

type BasicContainer

type BasicContainer struct {
	BasicWidget
	// contains filtered or unexported fields
}

BasicContainer is an basic implementation of Container.

func (*BasicContainer) Add

func (container *BasicContainer) Add(widget Widget)

Add widget as child.

func (*BasicContainer) Children

func (container *BasicContainer) Children() []Widget

Children returns the children.

func (*BasicContainer) Remove

func (container *BasicContainer) Remove(widget Widget)

Remove the given box from container if has it

type BasicWidget

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

BasicWidget is an basic implementation of Widget.

func (*BasicWidget) Draw

func (widget *BasicWidget) Draw(drawer Drawer)

Draw the container into screen

func (*BasicWidget) Height

func (widget *BasicWidget) Height() int

Height returns the height of container

func (*BasicWidget) Parent

func (widget *BasicWidget) Parent() Container

Parent returns the box where container is inside.

func (*BasicWidget) SetHeight

func (widget *BasicWidget) SetHeight(height int)

SetHeight set the height of container

func (*BasicWidget) SetWidth

func (widget *BasicWidget) SetWidth(width int)

SetWidth set the width of container

func (*BasicWidget) Width

func (widget *BasicWidget) Width() int

Width returns the width of container

type Container

type Container interface {
	Widget

	Add(widget Widget)
	Remove(widget Widget)

	Children() []Widget
}

Container is a widget that can hold others widgets.

type Drawer

type Drawer = backend.Drawer

func NewDrawer

func NewDrawer(im *image.RGBA) Drawer

type Widget

type Widget interface {
	Parent() Container

	Height() int
	SetHeight(height int)

	Width() int
	SetWidth(width int)

	Draw(drawer Drawer)
}

Widget is a component of GUI.

type Window

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

Window holds native-window handler

func CreateWindow

func CreateWindow(title string, x, y, width, height int) *Window

func (*Window) Add

func (w *Window) Add(widget Widget)

func (*Window) Children

func (w *Window) Children() []Widget

func (*Window) Close

func (w *Window) Close()

func (*Window) Draw

func (w *Window) Draw(drawer Drawer)

Draw must not be called! it panics.

func (*Window) Height

func (w *Window) Height() int

func (*Window) OnClose

func (w *Window) OnClose(callback func(window *Window))

OnClose add close event listener or remove if callback is nil.

func (*Window) OnResize

func (w *Window) OnResize(callback func(window *Window, width, height int))

OnResize add resize event listener or remove if callback is nil.

func (*Window) Parent

func (w *Window) Parent() Container

func (*Window) Remove

func (w *Window) Remove(widget Widget)

func (*Window) SetHeight

func (w *Window) SetHeight(height int)

func (*Window) SetVisibility

func (w *Window) SetVisibility(visibility bool)

func (*Window) SetWidth

func (w *Window) SetWidth(width int)

func (*Window) Width

func (w *Window) Width() int

Directories

Path Synopsis
example
app

Jump to

Keyboard shortcuts

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