gts

package
v0.0.0-...-6513b37 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const AppID = "com.github.diamondburned.cchat-gtk"

Variables

View Source
var App struct {
	*gtk.Application
	Window    *handy.ApplicationWindow
	Throttler *throttler.State
	// contains filtered or unexported fields
}
View Source
var Args = append([]string{}, os.Args...)
View Source
var Clipboard *gtk.Clipboard

Clipboard is initialized on init().

Functions

func AddAppAction

func AddAppAction(name string, call func())

func AddWindow

func AddWindow(w Windower)

func AfterFunc

func AfterFunc(d time.Duration, f func()) (stop func())

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

func AsyncCtx(ctx context.Context, fn func() (func(), error))

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 DoAfter

func DoAfter(d time.Duration, f func())

DoAfter calls f after the given duration in the Gtk main loop.

func DoAfterMs

func DoAfterMs(ms uint, f func())

DoAfterMs calls f after the given ms in the Gtk main loop.

func EventIsLeftClick

func EventIsLeftClick(ev *gdk.Event) bool

func EventIsRightClick

func EventIsRightClick(ev *gdk.Event) bool

func ExecAsync

func ExecAsync(fn func())

ExecAsync executes function asynchronously in the Gtk main thread. TODO: deprecate Async.

func ExecAsyncCtx

func ExecAsyncCtx(ctx context.Context, fn func())

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 IsClosing

func IsClosing() bool

IsClosing returns true if the window is destroyed.

func LoadCSS

func LoadCSS(name, css string)

func Main

func Main(wfn func() MainApplication)

func NewEmptyModalDialog

func NewEmptyModalDialog() (*gtk.Dialog, error)

func NewModalDialog

func NewModalDialog() (*gtk.Dialog, error)

NewModalDialog returns a new modal dialog that's transient for the main window.

func SpawnUploader

func SpawnUploader(dirpath string, callback func(absolutePaths []string))

Types

type MainApplication

type MainApplication interface {
	gtk.IWidget
	Menu() *glib.MenuModel
	Icon() *gdk.Pixbuf // assume scale 1
	Close()
}

type Windower

type Windower interface {
	gtk.IWidget
	gtk.IWindow
	throttler.Connector
}

Windower is the interface for a window.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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