gui

package
v0.0.0-...-28f6ca2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackColor = color.RGBA{0, 0, 0, 255}

BackColor xxx

View Source
var ForeColor = color.RGBA{255, 255, 255, 255}

ForeColor xxx

View Source
var GreenColor = color.RGBA{0, 0xff, 0, 0xff}

GreenColor xxx

View Source
var RedColor = color.RGBA{255, 0, 0, 255}

RedColor xxx

View Source
var ToolMakers = make(map[string]ToolMaker)

ToolMakers xxx

Functions

func DoUpstream

func DoUpstream(w Window, cmd string, arg interface{})

DoUpstream xxx

func GetAttValue

func GetAttValue(w Window, name string) string

GetAttValue xxx

func GetWindowID

func GetWindowID(parent Window, w Window) string

GetWindowID xxx

func MoveWindow

func MoveWindow(parent Window, child Window, delta image.Point)

MoveWindow xxx

func PointString

func PointString(p image.Point) string

PointString xxx

func RectString

func RectString(r image.Rectangle) string

RectString xxx

func RedrawChildren

func RedrawChildren(parent Window)

RedrawChildren xxx

func RegisterToolType

func RegisterToolType(name string, newfunc ToolMaker)

RegisterToolType xxx

func RemoveChild

func RemoveChild(parent Window, child Window)

RemoveChild xxx

func Run

func Run()

Run runs the Gui and never returns

func SetAttValue

func SetAttValue(w Window, name string, val string)

SetAttValue xxx

func StringToPoint

func StringToPoint(s string) (p image.Point)

StringToPoint xxx

func StringToRect

func StringToRect(s string) (r image.Rectangle)

StringToRect xxx

func ToBool

func ToBool(arg interface{}) bool

ToBool xxx

func ToColor

func ToColor(arg interface{}) color.RGBA

ToColor xxx

func ToPoint

func ToPoint(arg interface{}) image.Point

ToPoint xxx

func ToRect

func ToRect(arg interface{}) image.Rectangle

ToRect xxx

func ToString

func ToString(arg interface{}) string

ToString xxx

func ToolType

func ToolType(w Window) string

ToolType xxx

func WinChildPos

func WinChildPos(parent Window, child Window) (p image.Point)

WinChildPos xxx

func WinChildRect

func WinChildRect(parent, child Window) (r image.Rectangle)

WinChildRect xxx

func WinCurrSize

func WinCurrSize(w Window) (p image.Point)

WinCurrSize xxx

func WinForwardMouse

func WinForwardMouse(w Window, mouse MouseCmd)

WinForwardMouse is a utility function for Tools that just want to forward all their mouse events to whatever sub-windows they have.

func WinMinSize

func WinMinSize(w Window) (r image.Point)

WinMinSize xxx

func WinRelativePos

func WinRelativePos(parent Window, w Window, pos image.Point) image.Point

WinRelativePos xxx

func WinSetChildPos

func WinSetChildPos(parent Window, child Window, pos image.Point)

WinSetChildPos xxx

func WinSetChildSize

func WinSetChildSize(w Window, size image.Point)

WinSetChildSize xxx

func WinSetMySize

func WinSetMySize(w Window, size image.Point)

WinSetMySize xxx

func WindowRaise

func WindowRaise(parent Window, raise Window)

WindowRaise moves w to the top of the order

Types

type Button

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

Button xxx

func (*Button) Context

func (button *Button) Context() *WinContext

Context xxx

func (*Button) Do

func (button *Button) Do(cmd string, arg interface{}) (interface{}, error)

Do xxx

type CloseYourselfCmd

type CloseYourselfCmd struct {
}

CloseYourselfCmd xxx

type Cmd

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

Cmd xxx

type DownDragUp

type DownDragUp int

DownDragUp xxx

const (
	MouseUp DownDragUp = iota
	MouseDown
	MouseDrag
)

MouseUp xxx

type DrawLineCmd

type DrawLineCmd struct {
	XY0, XY1 image.Point
}

DrawLineCmd xxx

func ToDrawLine

func ToDrawLine(arg interface{}) DrawLineCmd

ToDrawLine xxx

type DrawTextCmd

type DrawTextCmd struct {
	Text string
	Face font.Face
	Pos  image.Point
}

DrawTextCmd xxx

func ToDrawText

func ToDrawText(arg interface{}) DrawTextCmd

ToDrawText xxx

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

Menu xxx

func ToMenu

func ToMenu(arg interface{}) *Menu

ToMenu xxx

func (menu *Menu) Context() *WinContext

Context xxx

func (menu *Menu) Do(cmd string, arg interface{}) (interface{}, error)

Do xxx

func (menu *Menu) SetItems(items []MenuItem)

SetItems xxx

type MenuCallback func(item string)

MenuCallback xxx

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

MenuItem xxx

type MouseCmd

type MouseCmd struct {
	Pos     image.Point
	ButtNum int
	Ddu     DownDragUp
}

MouseCmd xxx

func ToMouse

func ToMouse(arg interface{}) MouseCmd

ToMouse xxx

type MouseDrawer

type MouseDrawer func()

MouseDrawer xxx

type MouseHandler

type MouseHandler func(MouseCmd)

MouseHandler xxx

type Page

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

Page is the top-most Window

var CurrentPage *Page

CurrentPage xxx

func (*Page) AddTool

func (page *Page) AddTool(name string, pos image.Point, size image.Point) (Window, error)

AddTool xxx

func (*Page) Context

func (page *Page) Context() *WinContext

Context xxx

func (*Page) Do

func (page *Page) Do(cmd string, arg interface{}) (interface{}, error)

Do xxx

func (*Page) MakeTool

func (page *Page) MakeTool(name string) (ToolData, error)

MakeTool xxx

type Screen

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

Screen satisfies the ebiten.Game interface. Screen contains the pageWindow. Screen and Style should be the only things calling ebiten.

func (*Screen) Context

func (screen *Screen) Context() *WinContext

Context xxx

func (*Screen) Do

func (screen *Screen) Do(cmd string, arg interface{}) (interface{}, error)

Do xxx

func (*Screen) Draw

func (screen *Screen) Draw(eimage *ebiten.Image)

Draw satisfies the ebiten.Game interface

func (*Screen) Layout

func (screen *Screen) Layout(width, height int) (int, int)

Layout satisfies the ebiten.Game interface

func (*Screen) Update

func (screen *Screen) Update() (err error)

Update satisfies the ebiten.Game interface

type ScrollingText

type ScrollingText struct {
	Buffer []string
	// contains filtered or unexported fields
}

ScrollingText assumes a fixed-width font

func (*ScrollingText) AddLine

func (st *ScrollingText) AddLine(line string)

AddLine xxx

func (*ScrollingText) Clear

func (st *ScrollingText) Clear()

Clear clears all text

func (*ScrollingText) Context

func (st *ScrollingText) Context() *WinContext

Context xxx

func (*ScrollingText) Do

func (st *ScrollingText) Do(cmd string, arg interface{}) (interface{}, error)

Do xxx

type Style

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

Style xxx

func DefaultStyle

func DefaultStyle() *Style

DefaultStyle xxx

func NewStyle

func NewStyle(fontName string, fontHeight int) *Style

NewStyle xxx

func WinStyle

func WinStyle(w Window) *Style

WinStyle xxx

func (*Style) BoundString

func (style *Style) BoundString(s string) image.Rectangle

BoundString xxx

func (*Style) CharWidth

func (style *Style) CharWidth() int

CharWidth is a single character's width

func (*Style) RowHeight

func (style *Style) RowHeight() int

RowHeight is the height of text rows (e.g. in ScrollingTextArea)

func (*Style) TextFitRect

func (style *Style) TextFitRect(s string) image.Rectangle

TextFitRect xxx

func (*Style) TextHeight

func (style *Style) TextHeight() int

TextHeight xxx

func (*Style) TextWidth

func (style *Style) TextWidth(s string) int

TextWidth xxx

type SweepCallbackCmd

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

SweepCallbackCmd xxx

type TextCallback

type TextCallback func(updown string)

TextCallback xxx

type ToolData

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

ToolData fields are exported

func NewButton

func NewButton(parent Window, label string) ToolData

NewButton xxx

func NewMenu

func NewMenu(parent Window, toolType string, items []MenuItem) ToolData

NewMenu xxx

func NewPage

func NewPage(parent Window, name string) ToolData

NewPage xxx

func NewPageMenu

func NewPageMenu(parent Window) ToolData

NewPageMenu xxx

func NewScrollingText

func NewScrollingText(parent Window) ToolData

NewScrollingText xxx

func NewToolData

func NewToolData(w Window, toolType string, minSize image.Point) ToolData

NewToolData xxx

func NewToolsMenu

func NewToolsMenu(parent Window) ToolData

NewToolsMenu xxx

func NewWindowMenu

func NewWindowMenu(parent Window) ToolData

NewWindowMenu xxx

type ToolMaker

type ToolMaker func(parent Window) ToolData

ToolMaker xxx

type UpstreamCmd

type UpstreamCmd interface {
}

UpstreamCmd xxx

type WinContext

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

WinContext doesn't export any of its fields

func NewWindowContext

func NewWindowContext(parent Window) WinContext

NewWindowContext xxx

type Window

type Window interface {
	Context() *WinContext
	Do(cmd string, arg interface{}) (interface{}, error)
}

Window is the external (and networkable) interface to a Window instance. Context is only local (I think).

func AddChild

func AddChild(parent Window, td ToolData) Window

AddChild xxx

func ToWindow

func ToWindow(arg interface{}) Window

ToWindow xxx

func WinParent

func WinParent(w Window) Window

WinParent xxx

func WindowUnder

func WindowUnder(parent Window, pos image.Point) (Window, image.Point)

WindowUnder looks for a child window under a given point, and if there is one, returns both the window and a point that has been adjusted to make it relative to the child's coordinate space.

type WindowID

type WindowID int

WindowID xxx

func WinChildID

func WinChildID(parent Window, child Window) WindowID

WinChildID xxx

Jump to

Keyboard shortcuts

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