ui

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Panel constants
	LOGO_PANEL           = "logo"
	SAVED_DIAGRAMS_PANEL = "saved_diagrams"
	LOG_PANEL            = "log"
	DIAGRAM_PANEL        = "diagram"
	PROGRESS_PANEL       = "progress"
	HELP_PANEL           = "help"
	SAVE_MODAL           = "save_modal"
	PROGRESS_MODAL       = "progress_modal"

	// Log messages
	ERROR_EMPTY  = "The editor should not be empty!"
	DIAGRAMS_DIR = "/diagrams"
)

Variables

This section is empty.

Functions

func InitApp

func InitApp(fontpath string)

func NewButtonWidget

func NewButtonWidget(name string, x, y int, label string, handler func(g *gocui.Gui, v *gocui.View) error) *buttonWidget

Types

type Cursors

type Cursors map[string]struct {
	// contains filtered or unexported fields
}

Cursors stores the cursor position for a specific panel view. Used to restore mouse position when click is detected.

func NewCursors

func NewCursors() Cursors

func (Cursors) Get

func (c Cursors) Get(view string) (int, int)

func (Cursors) Restore

func (c Cursors) Restore(view *gocui.View) error

func (Cursors) Set

func (c Cursors) Set(view string, x, y int)

type Fn

type Fn func(*gocui.Gui, *gocui.View) error

type UI

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

func NewUI

func NewUI(fontpath string) *UI

func (*UI) ClearView

func (ui *UI) ClearView(name string)

ClearView clears the panel view.

func (*UI) Close

func (ui *UI) Close()

Close closes the app

func (*UI) DeleteView

func (ui *UI) DeleteView(name string)

DeleteView deletes the current view.

func (*UI) Init

func (ui *UI) Init()

func (*UI) Layout

func (ui *UI) Layout(g *gocui.Gui) error

Initialize the panel views and associate the key bindings to them.

func (*UI) Loop

func (ui *UI) Loop()

Loop starts the GUI loop

Jump to

Keyboard shortcuts

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