gwapp

package
v0.0.0-...-3929c03 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 11 Imported by: 1

Documentation

Overview

Package gwapp implements application initialization and message loop that can be used in any goroutine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GwApp

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

func New

func New() *GwApp

New creates a GwApp and do application initialization.

func (*GwApp) Post

func (app *GwApp) Post(f func()) error

Post put f into the UI message queue, f will run in the UI thread ASAP.

func (*GwApp) Quit

func (app *GwApp) Quit(exitCode int)

Quit calls win32.PostQuitMessage which tells the message loop to exit. The exit code will be the return value of Run.

func (*GwApp) Run

func (app *GwApp) Run() int

Run runs the message loop.

func (*GwApp) SetMessageDispatcher

func (app *GwApp) SetMessageDispatcher(dispatcher MessageDispatcher)

SetMessageDispatcher sets a dispatcher for windows message dispatching. The default message dispatcher is win32.DispatchMessageW.

type MessageDispatcher

type MessageDispatcher func(msg *win32.MSG, prevProc func(msg *win32.MSG) win32.LRESULT) win32.LRESULT

MessageDispatcher is a function that dispatches Windows messages. The prevProc parameter is the previous message dispatcher in the chain, which can be called to continue the default message processing.

Jump to

Keyboard shortcuts

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