ge_go_sdl2

package module
v0.0.0-...-237353c Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

README

ge-go-sdl2

This repository contains code for running an application runtime with gui support running with sdl2.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleAsCallback

func HandleAsCallback(channel chan string, callback func())

func HandleAsCallbackArg

func HandleAsCallbackArg[T interface{}](channel chan T, callback func(T))

func NotifyPropertyChange

func NotifyPropertyChange(id string, propertyName string, newValue interface{})

func NotifyPropertyChangeAsync

func NotifyPropertyChangeAsync(id string, propertyName string, newValue interface{})

func NotifyPropertyChangeCb

func NotifyPropertyChangeCb(id string, propertyName string, newValue interface{}, cb chan int)

func NotifyPropertyChangeCbAsync

func NotifyPropertyChangeCbAsync(id string, propertyName string, newValue interface{}, cb chan int)

func Run

func Run(gui []View)

Types

type Button

type Button struct {
	ContentLabel Text
	Content      string
	X            int32
	Y            int32
	W            int32
	H            int32
	BorderColor  uint32
	BgColor      uint32
	Id           string
	OnClick      chan string
}

type Container

type Container struct {
	Id     string
	ViewId string
	X      int32
	Y      int32
}

type HAlign

type HAlign int64
const (
	Left HAlign = iota
	Center
	Right
)

type Text

type Text struct {
	Content   string
	X         int32
	Y         int32
	W         int32
	H         int32
	Size      int
	Font      string
	TextColor sdl.Color
	Id        string
	Alignment HAlign
}

type TextField

type TextField struct {
	Value       string
	OnChanged   chan string
	X           int32
	Y           int32
	W           int32
	H           int32
	BorderColor uint32
	BgColor     uint32
	Size        int
	Font        string
	TextColor   sdl.Color
	Id          string
}

type View

type View struct {
	Id          string
	X           int32
	Y           int32
	W           int32
	H           int32
	BgColor     uint32
	BorderColor uint32
	Flags       uint
	Children    []interface{}
}

Jump to

Keyboard shortcuts

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