Documentation ¶
Index ¶
- Constants
- Variables
- func AddAppAction(name string, call func())
- func AddWindow(w Windower)
- func AfterFunc(d time.Duration, f func()) (stop func())
- func AfterMsFunc(ms uint, f func()) (stop func())
- func Async(fn func() (func(), error))
- func AsyncCancel(fn func(ctx context.Context) (func(), error)) context.CancelFunc
- func AsyncCtx(ctx context.Context, fn func() (func(), error))
- func BindPreviewer(fc *gtk.FileChooserNativeDialog)
- func DoAfter(d time.Duration, f func())
- func DoAfterMs(ms uint, f func())
- func EventIsLeftClick(ev *gdk.Event) bool
- func EventIsRightClick(ev *gdk.Event) bool
- func ExecAsync(fn func())
- func ExecAsyncCtx(ctx context.Context, fn func())
- func ExecLater(fn func())
- func IsClosing() bool
- func LoadCSS(name, css string)
- func Main(wfn func() MainApplication)
- func NewEmptyModalDialog() (*gtk.Dialog, error)
- func NewModalDialog() (*gtk.Dialog, error)
- func SpawnUploader(dirpath string, callback func(absolutePaths []string))
- type MainApplication
- type Windower
Constants ¶
const AppID = "com.github.diamondburned.cchat-gtk"
Variables ¶
var App struct { *gtk.Application Window *handy.ApplicationWindow Throttler *throttler.State // contains filtered or unexported fields }
var Args = append([]string{}, os.Args...)
var Clipboard *gtk.Clipboard
Clipboard is initialized on init().
Functions ¶
func AddAppAction ¶
func AddAppAction(name string, call func())
func AfterFunc ¶
AfterFunc mimics time.AfterFunc's API but runs the callback inside the Gtk main loop.
func AfterMsFunc ¶
func AfterMsFunc(ms uint, f func()) (stop func())
AfterMsFunc is similar to AfterFunc but takes in milliseconds instead.
func Async ¶
func Async(fn func() (func(), error))
Async runs fn asynchronously, then runs the function it returns in the Gtk main thread. TODO: deprecate Async.
func AsyncCancel ¶
func AsyncCancel(fn func(ctx context.Context) (func(), error)) context.CancelFunc
AsyncCancel is similar to AsyncCtx, but the context is created internally.
func AsyncCtx ¶
AsyncCtx does what Async does, except the returned callback will not be executed if the given context has expired or the returned callback is called.
func BindPreviewer ¶
func BindPreviewer(fc *gtk.FileChooserNativeDialog)
BindPreviewer binds the file chooser dialog with a previewer.
func DoAfterMs ¶
func DoAfterMs(ms uint, f func())
DoAfterMs calls f after the given ms in the Gtk main loop.
func EventIsLeftClick ¶
func EventIsRightClick ¶
func ExecAsync ¶
func ExecAsync(fn func())
ExecAsync executes function asynchronously in the Gtk main thread. TODO: deprecate Async.
func ExecAsyncCtx ¶
ExecAsyncCtx executes the function asynchronously in the Gtk main thread only if the context has not expired. This API has absolutely no race conditions if the context is only canceled in the main thread.
func ExecLater ¶
func ExecLater(fn func())
ExecLater executes the function asynchronously with a low priority.
func Main ¶
func Main(wfn func() MainApplication)
func NewEmptyModalDialog ¶
func NewModalDialog ¶
NewModalDialog returns a new modal dialog that's transient for the main window.