utils

package
v0.0.0-...-ee38f14 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCSSClass

func AddCSSClass(widget gtk.Widget, cssClass string)

func ChooseFolder

func ChooseFolder(parent *gtk.Window, title string) string

func ClearChildren

func ClearChildren(parent gtk.Container)

func HandleErr

func HandleErr(err error)

func Must

func Must[T any](val T, err error) T

func Scrollable

func Scrollable[T gtk.IWidget](child T) *gtk.ScrolledWindow

func ShowEntryDialog

func ShowEntryDialog(parent *gtk.Window, title, label string) string

func ShowErrorDialog

func ShowErrorDialog(parent *gtk.Window, message string)

func ShowInfoDialog

func ShowInfoDialog(parent *gtk.Window, message string)

Types

type Editor

type Editor struct {
	*gtk.ScrolledWindow

	View   *sourceview.SourceView
	Buffer *sourceview.SourceBuffer
}

func NewEditor

func NewEditor(initialText string, editable bool, extention string) *Editor

type KeyValueEditor

type KeyValueEditor struct {
	*gtk.ScrolledWindow
	Store *PairStore
}

func NewKeyValueEditor

func NewKeyValueEditor(values map[string]string) *KeyValueEditor

func (*KeyValueEditor) OnAfterUpdate

func (kve *KeyValueEditor) OnAfterUpdate(handler func())

type KeyValuePair

type KeyValuePair struct {
	Key   string
	Value string
}

type PairStore

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

func (*PairStore) Add

func (s *PairStore) Add(key, value string)

func (*PairStore) Delete

func (s *PairStore) Delete(index int)

func (*PairStore) Get

func (s *PairStore) Get(key string) string

func (*PairStore) List

func (s *PairStore) List() []*KeyValuePair

func (*PairStore) ToMap

func (s *PairStore) ToMap() map[string]string

Jump to

Keyboard shortcuts

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