Documentation ¶
Index ¶
- Constants
- Variables
- func DispatchEvent() int
- func Exit(code int)
- func GetCursorPos(wnd uintptr) (x, y float32, err error)
- func GetScreenSize(id int) (width, height float32, err error)
- func IsMainThread() bool
- func Loop(quit <-chan interface{}) (ret interface{})
- func MainThreadAsync(result *chan error, fn func() error)
- func MainThreadCall(fn func() error) error
- func NumWindows() int
- func Running() bool
- func Yield()
- type IHandler
- type SysSpecial
- type Window
- type WindowHandle
- type WindowOptions
Constants ¶
View Source
const ( HintWindowResizable = 1 << iota HintWindowFullScreen )
View Source
const ( MouseBtnLeft = 1 << iota MouseBtnRight MouseBtnMiddle )
View Source
const ( Dispatched = 0 RequestToQuit = 1 QueueEmpty = 2 )
Variables ¶
View Source
var ( ErrGeneric = errors.New("generic error") KeepRunningWithoutWindow bool )
Functions ¶
func DispatchEvent ¶
func DispatchEvent() int
func GetCursorPos ¶
func GetScreenSize ¶
func IsMainThread ¶
func IsMainThread() bool
IsMainThread reports whether current thread is the main thread
func MainThreadAsync ¶
func MainThreadCall ¶
func NumWindows ¶
func NumWindows() int
Types ¶
type IHandler ¶
type IHandler interface { OnCreate() OnRequestClose() bool OnDestroy() OnActivate(active bool) OnAppear(visible bool) OnResize(width, height float32) OnMouseMove(x, y float32) OnMousePress(btn int, x, y float32) OnMouseRelease(btn int, x, y float32) OnMouseWheel(axis int, delta, x, y float32) // up is positive OnMouseEnter(x, y float32) OnMouseLeave(x, y float32) OnExpose(x, y, width, height float32) }
IHandler is a complete Handler interface, for document purpose.
type SysSpecial ¶
type SysSpecial struct {
// contains filtered or unexported fields
}
type Window ¶
type Window struct { WindowHandle Handler interface{} SysSpecial // contains filtered or unexported fields }
Window represent a native window, it wraps a HWND on Windows, XCB visual or XLib Window on Linux, NSView on MacOS.
func (*Window) ExposeRect ¶
func (*Window) Init ¶
func (win *Window) Init(o *WindowOptions) (err error)
func (*Window) SetVisible ¶
type WindowHandle ¶
type WindowOptions ¶
Click to show internal directories.
Click to hide internal directories.