gtk

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Copyright (c) 2018 Hervé Gouchet. All rights reserved. Use of this source code is governed by the MIT License that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnkDialog ...
	ErrUnkDialog = errors.New("unknown dialog")
	// ErrFileSystem ...
	ErrFileSystem = errors.New("invalid file system")
	// ErrUndColumn ...
	ErrUndColumn = errors.New("missing columns")
	// ErrUndObject ...
	ErrUndObject = errors.New("missing object")
	// ErrContainer ...
	ErrContainer = errors.New("invalid window")
)

Functions

func NewBuilder

func NewBuilder(xml string) (*gtk.Builder, error)

NewBuilder ...

func NewButton

func NewButton(label string, clicked Func, margin ...int) (*gtk.Button, error)

NewButton ...

func NewHBox

func NewHBox() (*gtk.Box, error)

NewHBox ...

func NewLabel

func NewLabel(label, font string, margin ...int) (*gtk.Label, error)

NewLabel ...

func NewLevelBar

func NewLevelBar(val, min, max int) (*gtk.LevelBar, error)

NewLevelBar ...

func NewScrolledWindow

func NewScrolledWindow(h, v bool) (*gtk.ScrolledWindow, error)

NewScrolledWindow ...

func NewSearchEntry

func NewSearchEntry(placeholder string, search FuncOne, margin ...int) (*gtk.SearchEntry, error)

NewSearchEntry ...

func NewVBox

func NewVBox() (*gtk.Box, error)

NewVBox ...

Types

type Application

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

Application ...

func Init

func Init(args *[]string, db *app.Safe, log Logger, debug bool) (*Application, error)

Init ...

func (*Application) Run

func (a *Application) Run()

Run ...

type Builder

type Builder interface {
}

Builder ... todo

type Clipboard

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

Clipboard ...

func NewClipboard

func NewClipboard() (*Clipboard, error)

NewClipboard ...

func (*Clipboard) Copy

func (c *Clipboard) Copy(text string)

Copy ...

type ConfirmDialog

type ConfirmDialog struct {
	*Dialog
	// contains filtered or unexported fields
}

ConfirmDialog ...

func (*ConfirmDialog) Init

func (d *ConfirmDialog) Init() (err error)

func (*ConfirmDialog) Log

func (d *ConfirmDialog) Log(format string, args ...interface{})

Log implements the Plugin interface.

func (*ConfirmDialog) Reload

func (d *ConfirmDialog) Reload(tag string, vault ...string)

Reload ...

func (*ConfirmDialog) Reset

func (d *ConfirmDialog) Reset() error

Reset ...

type Container

type Container interface {
	ID(name string) (glib.IObject, error)
	Init() error
	Reset() error
}

Container ...

type DataTable

type DataTable interface {
	Cols() []string
	ColSizes() []int
	ColID() int
	Rows() [][]interface{}
	Types() []glib.Type
	Title() string
}

DataTable ...

type Dialog

type Dialog struct {
	*Object
	// contains filtered or unexported fields
}

Dialog ...

func NewDialog

func NewDialog(parent *Window, id, xml string) (*Dialog, error)

NewDialog ...

func (*Dialog) App

func (d *Dialog) App() *app.Safe

App implements the Plugin interface.

func (*Dialog) Hide

func (d *Dialog) Hide()

Hide implements the Visibility interface.

func (*Dialog) IWidget

func (d *Dialog) IWidget() gtk.IWidget

IWidget ...

func (*Dialog) Log

func (d *Dialog) Log(format string, args ...interface{})

Log implements the Plugin interface.

func (*Dialog) Parent

func (d *Dialog) Parent() *Window

Parent ...

func (*Dialog) Show

func (d *Dialog) Show()

Show implements the Visibility interface.

type Func

type Func func()

Func ...

type FuncOne

type FuncOne func(string)

FuncOne ...

type FuncTwo

type FuncTwo func(string, string)

FuncTwo ....

type Listener

type Listener interface {
}

Listener ... todo

type LoadVisibleWidgetContainer

type LoadVisibleWidgetContainer interface {
	VisibleWidgetContainer
	ReLoader
}

LoadVisibleWidgetContainer ...

type Logger

type Logger interface {
	// Printf logs a message at level Info on the standard logger.
	Printf(format string, args ...interface{})
}

Logger must be implemented by any logger.

type Notebook

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

Notebook ...

func NewNotebook

func NewNotebook(name string, clicked Func, pages map[string]*tagNote) (*Notebook, error)

NewNotebook ...

func (*Notebook) AddPage

func (n *Notebook) AddPage(p *tagNote) error

AddPage ...

func (*Notebook) Notebook

func (n *Notebook) Notebook() *gtk.Notebook

Notebook ...

type Object

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

Object ...

func NewObject

func NewObject(id, xml string) (*Object, error)

NewObject ...

func (*Object) Activate

func (o *Object) Activate(id string, enable bool) error

Activate ...

func (*Object) ButtonClicked

func (o *Object) ButtonClicked(id string, fn Func) (err error)

ButtonClicked ...

func (*Object) Closed added in v0.2.1

func (o *Object) Closed(fn func()) (err error)

Closed ...

func (*Object) EditEntry added in v0.2.1

func (o *Object) EditEntry(id, text string, ok bool) (err error)

EditEntry ...

func (*Object) EnterPressed added in v0.2.1

func (o *Object) EnterPressed(id string, fn Func) error

EnterPressed ...

func (*Object) Error

func (o *Object) Error(id, msg string) (err error)

Error ...

func (*Object) Focus added in v0.2.1

func (o *Object) Focus(id string) (err error)

Focus ...

func (*Object) ID

func (o *Object) ID(name string) (glib.IObject, error)

ID ...

func (*Object) IObject

func (o *Object) IObject() glib.IObject

Container ...

func (*Object) IsActivated

func (o *Object) IsActivated(id string) (enable bool, err error)

IsActivated ...

func (*Object) ReadEntry

func (o *Object) ReadEntry(id string) (string, error)

ReadEntry ...

func (*Object) ReadSpinButton

func (o *Object) ReadSpinButton(id string) (int, error)

ReadSpinButton ...

func (*Object) WriteEntry

func (o *Object) WriteEntry(id, text string) (err error)

WriteEntry ...

func (*Object) WriteSpinButton

func (o *Object) WriteSpinButton(id string, num int) error

WriteSpinButton ...

type Plugin

type Plugin interface {
	App() *app.Safe
	Log(format string, args ...interface{})
}

Plugin ...

type ReLoader

type ReLoader interface {
	Reload(tag string, vault ...string)
}

ReLoader ...

type SignDialog

type SignDialog struct {
	*Dialog
}

SignDialog ...

func (*SignDialog) Init

func (d *SignDialog) Init() (err error)

Init ...

func (*SignDialog) Log

func (d *SignDialog) Log(format string, args ...interface{})

Log implements the Plugin interface.

func (*SignDialog) Reset

func (d *SignDialog) Reset() (err error)

Reset ...

type TagDialog

type TagDialog struct {
	*Dialog
}

TagDialog ...

func (*TagDialog) Init

func (d *TagDialog) Init() (err error)

Init ...

func (*TagDialog) Log

func (d *TagDialog) Log(format string, args ...interface{})

Log implements the Plugin interface.

func (*TagDialog) Reset

func (d *TagDialog) Reset() (err error)

Reset ...

type TreeView

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

TreeView ...

func NewTreeView

func NewTreeView(list DataTable, changed FuncTwo) (*TreeView, error)

NewTreeView ...

func (*TreeView) AddRow

func (t *TreeView) AddRow(d []interface{}) error

AddRow ...

func (*TreeView) DelRow

func (t *TreeView) DelRow(name string) error

DelRow ...

func (*TreeView) Len

func (t *TreeView) Len() int

Len ...

func (*TreeView) ScrollTreeView

func (t *TreeView) ScrollTreeView(v, h bool) (*gtk.ScrolledWindow, error)

ScrollTreeView ...

func (*TreeView) Search

func (t *TreeView) Search(q string)

Search ...

func (*TreeView) TreeView

func (t *TreeView) TreeView() *gtk.TreeView

TreeView ...

func (*TreeView) UpdRow

func (t *TreeView) UpdRow(name string, d []interface{}) error

UpdRow ...

type VaultDialog

type VaultDialog struct {
	*Dialog
	// contains filtered or unexported fields
}

VaultDialog ...

func (*VaultDialog) Init

func (d *VaultDialog) Init() (err error)

func (*VaultDialog) Log

func (d *VaultDialog) Log(format string, args ...interface{})

Log implements the Plugin interface.

func (*VaultDialog) Reload

func (d *VaultDialog) Reload(tag string, vault ...string)

Reload ...

func (*VaultDialog) Reset

func (d *VaultDialog) Reset() (err error)

Reset ...

type Visibility

type Visibility interface {
	Hide()
	Show()
}

/ Visibility ...

type VisibleWidgetContainer

type VisibleWidgetContainer interface {
	WidgetContainer
	Visibility
}

VisibleContainer ...

type WidgetContainer

type WidgetContainer interface {
	Container
	Plugin
	IWidget() gtk.IWidget
}

WidgetContainer

type Window

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

Window ...

func NewWindow

func NewWindow(app *app.Safe, log Logger, title string, width, height int) (*Window, error)

NewWindow ...

func (*Window) AddTag

func (w *Window) AddTag(name string) error

AddTag ...

func (*Window) App

func (w *Window) App() *app.Safe

App ...

func (*Window) AttachDialog

func (w *Window) AttachDialog(c VisibleWidgetContainer) error

AttachDialog ...

func (*Window) Build

func (w *Window) Build() error

Build ...

func (*Window) Close

func (w *Window) Close() error

Close ...

func (*Window) DeleteVault

func (w *Window) DeleteVault(tag, vault string) error

DeleteVault ...

func (*Window) Hide

func (w *Window) Hide()

Hide implements the Visibility interface.

func (*Window) Log

func (w *Window) Log(format string, args ...interface{})

Log ...

func (*Window) Run

func (w *Window) Run()

ShowAll implements the Visibility interface.

func (*Window) Show

func (w *Window) Show()

Show implements the Visibility interface.

func (*Window) ShowDelVaultConfirm

func (w *Window) ShowDelVaultConfirm(tag, vault string)

ShowDelVaultConfirm ...

func (*Window) ShowNewVaultDialog

func (w *Window) ShowNewVaultDialog(tag string)

ShowVaultDialog ...

func (*Window) ShowTagDialog

func (w *Window) ShowTagDialog()

ShowTagDialog ...

func (*Window) ShowUpdVaultDialog

func (w *Window) ShowUpdVaultDialog(tag, vault string)

ShowVaultDialog ...

func (*Window) ShowVaultInfo

func (w *Window) ShowVaultInfo(tag, vault string)

ShowVaultInfo ...

func (*Window) UpsertVault

func (w *Window) UpsertVault(v *safe.Vault, add bool) error

AddVault ...

func (*Window) Window

func (w *Window) Window() *gtk.Window

Window ...

Jump to

Keyboard shortcuts

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