uiutil

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicUI

type BasicUI struct {
	DrawFrameRate int // frames per second
	RootNode      widget.Node
	Win           driver.Window
	// contains filtered or unexported fields
}

func NewBasicUI

func NewBasicUI(winName string, root widget.Node) (*BasicUI, error)

func (*BasicUI) AppendEvent

func (ui *BasicUI) AppendEvent(ev any)

func (*BasicUI) Close

func (ui *BasicUI) Close()

func (*BasicUI) EnqueueNoOpEvent

func (ui *BasicUI) EnqueueNoOpEvent()

func (*BasicUI) GetClipboardData added in v1.3.0

func (ui *BasicUI) GetClipboardData(i event.ClipboardIndex, fn func(string, error))

func (*BasicUI) HandleEvent

func (ui *BasicUI) HandleEvent(ev any) (handled bool)

func (*BasicUI) Image

func (ui *BasicUI) Image() draw.Image

func (*BasicUI) LayoutMarkedAndSchedulePaint

func (ui *BasicUI) LayoutMarkedAndSchedulePaint()

func (*BasicUI) NextEvent

func (ui *BasicUI) NextEvent() any

How to use NextEvent():

func SampleEventLoop() {
	defer ui.Close()
	for {
		ev := ui.NextEvent()
		switch t := ev.(type) {
		case error:
			fmt.Println(err)
		case *event.WindowClose:
			return
		default:
			ui.HandleEvent(ev)
		}
		ui.LayoutMarkedAndSchedulePaint()
	}
}

func (*BasicUI) QueryPointer

func (ui *BasicUI) QueryPointer() (image.Point, error)

func (*BasicUI) QueueEmptyWindowInputEvent

func (ui *BasicUI) QueueEmptyWindowInputEvent()

Allows triggering a run of applyevent (ex: useful for cursor update, needs point or it won't work).

func (*BasicUI) RunOnUIGoRoutine

func (ui *BasicUI) RunOnUIGoRoutine(f func())

func (*BasicUI) SetClipboardData added in v1.3.0

func (ui *BasicUI) SetClipboardData(i event.ClipboardIndex, s string)

func (*BasicUI) SetCursor

func (ui *BasicUI) SetCursor(c event.Cursor)

Implements widget.CursorContext

func (*BasicUI) WaitRunOnUIGoRoutine added in v1.3.0

func (ui *BasicUI) WaitRunOnUIGoRoutine(f func())

Use with care to avoid UI deadlock (waiting within another wait).

func (*BasicUI) WarpPointer

func (ui *BasicUI) WarpPointer(p image.Point)

type UIPaintTime

type UIPaintTime struct{}

type UIRunFuncEvent

type UIRunFuncEvent struct {
	Func func()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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