gtk3Import

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2019 License: MIT, MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Creat = "H.F.M"
View Source
var Descr = "Golang parser for glade xml files"
View Source
var LicenseAbrv = "License (MIT)"
View Source
var LicenseShort = "" /* 140-byte string literal not displayed */
View Source
var LicenseUrl = "https://opensource.org/licenses/mit-license.php"
View Source
var Name = "GladeXmlParser"
View Source
var Repository = "github.com/..."
View Source
var Vers = "v2.0"
View Source
var YearCreat = "2019"

Functions

func ComboBoxTextFill

func ComboBoxTextFill(cbxEntry *gtk.ComboBoxText, entries []string, removAll ...bool)

Fill / Clean comboBoxText

func ComboBoxTextGetEntry

func ComboBoxTextGetEntry(cbxEntry *gtk.ComboBoxText) string

Get text from gtk.comboBoxTextEntry object

func DlgMessage

func DlgMessage(window *gtk.Window, dlgType, title, text string, iconFileName interface{}, buttons ...string) (value int)

DlgMessage: Display message dialog whit multiples buttons, text inside accet markup format, return get <0 for cross closed or >-1 correspondig to buttons order representation. "info", "warning", "question", "error", "other" as dlgType. iconFileName: "" = No image

func FileChooser

func FileChooser(window *gtk.Window, dlgType, title, filename string, options ...bool) (outFilename string, result bool, err error)

FileChooser: Display a file chooser dialog. "open", "save", "create-folder", "select-folder" as dlgType. Set title "" permit auto choice from dialog type. options are 1-keepAbove and 2-enablePreviewImages

func FlipImage

func FlipImage(varPath interface{}, horizontal bool) (outPixbuf *gdk.Pixbuf, err error)

FlipImage: Get Flipped gtk.Pixbuff image representation from file or []byte, depending on type

func GetOsLineEnd

func GetOsLineEnd() string

GetOsLineEnd: Get current OS line-feed

func GetStrIndex2dCol

func GetStrIndex2dCol(slice [][]string, value string, col int) int

GetStrIndex2dCol: Search in 2d string slice if a column's value exist and return row number.

func GetTextEOL

func GetTextEOL(inTextBytes []byte) (outString string)

GetTextEOL: Get EOL from text bytes (CR, LF, CRLF) > string or get OS line end.

func HexToBytes

func HexToBytes(varPath string, gzipData []byte) (outByte []byte)

HexToBytes: Convert Gzip Hex to []byte used for embedded binary in source code

func JsonRead

func JsonRead(filename string, interf interface{}) (err error)

JsonRead: datas from file to given interface / structure i.e: err := ReadJson(filename, &person) remember to put upper char at left of variables names to be saved.

func JsonWrite

func JsonWrite(filename string, interf interface{}) (err error)

JsonWrite: datas to file from given interface / structure i.e: err := WriteJson(filename, &person) remember to put upper char at left of variables names to be saved.

func ListStoreAddRow

func ListStoreAddRow(listStore *gtk.ListStore, row []string) (iter *gtk.TreeIter)

ListStoreAddRow: Append a row to the listStore

func LowercaseAtFirst

func LowercaseAtFirst(inString string) bool

LowercaseAtFirst: true if 1st char is lowercase (Exist into GenLib too !)

func MarkupHttpClickable

func MarkupHttpClickable(inString string) (outString string)

MarkupHttpClickable:

func NormalizeSize

func NormalizeSize(oldWidth, oldHeight, newValue, format int) (outWidth, outHeight int)

NormalizeSize: compute new size with kept proportions based on defined format. format: 0 percent, 1 reducing width, 2 reducing height

func Notify

func Notify(title, text string)

Notify: Display a notify message at the top right of screen.

func ResizeImage

func ResizeImage(varPath interface{}, width, height int, interp ...int) (outPixbuf *gdk.Pixbuf, err error)

ResizeImage: Get Resized gtk.Pixbuff image representation from file or []byte, depending on type interp: 0 GDK_INTERP_NEAREST, 1 GDK_INTERP_TILES, 2 GDK_INTERP_BILINEAR (default), 3 GDK_INTERP_HYPER.

func RotateImage

func RotateImage(varPath interface{}, angle gdk.PixbufRotation) (outPixbuf *gdk.Pixbuf, err error)

RotateImage: Rotate by 90,180,270 degres and get gtk.Pixbuff image representation from file or []byte, depending on type

func SetButtonImage

func SetButtonImage(object *gtk.Button, varPath interface{}, size ...int)

setButtonImage: Set Icon to GtkButton objects

func SetImage

func SetImage(object *gtk.Image, varPath interface{}, size ...int)

setImage: Set Image to GtkImage objects

func SetToggleButtonImage

func SetToggleButtonImage(object *gtk.ToggleButton, varPath interface{}, size ...int)

setToggleButtonImage: Set Icon to GtkToggleButton objects

func SetWinIcon

func SetWinIcon(object *gtk.Window, varPath interface{}, size ...int)

setWinIcon: Set Icon to GtkWindow objects

func SpinbuttonSetValues

func SpinbuttonSetValues(sb *gtk.SpinButton, min, max, value int, step ...int) (err error)

SpinbuttonSetValues: Configure spin button

func TEST_TreeStore

func TEST_TreeStore(treeStore *gtk.TreeStore)

TEST purpose with pango markup style

func TimeStamp

func TimeStamp() *timeStamp

Get current timestamp

func TreeStoreAddRow

func TreeStoreAddRow(treeStore *gtk.TreeStore, row string) *gtk.TreeIter

TreeStoreAddRow: Append a toplevel row to the tree store for the tree view

func TreeStoreAddSubRow

func TreeStoreAddSubRow(treeStore *gtk.TreeStore, iter *gtk.TreeIter, row ...string) *gtk.TreeIter

TreeStoreAddSubRow: Append a sub row to the tree store for the tree view

func TreeViewCreateTextColumn

func TreeViewCreateTextColumn(title string, id int, cellAttributes []string, editable ...bool) *gtk.TreeViewColumn

TreeViewCreateTextColumn: Add a column to the tree view

func TreeViewGetRowsNb

func TreeViewGetRowsNb(tw *gtk.TreeView, ls *gtk.ListStore) (rowsNb []int)

*********************

  • TreeView section ********************

TreeViewGetRowsNb: Get selected rows numbers

func TreeViewListStoreSetup

func TreeViewListStoreSetup(treeView *gtk.TreeView, multiSelect bool, columns [][]string, editable ...bool) (listStore *gtk.ListStore)

TreeViewListStoreSetup: Setup tree view columns and the list store that holds its data. options set combine multiselection and editable property.

func TreeViewTreeStoreSetup

func TreeViewTreeStoreSetup(treeView *gtk.TreeView, multiSelect bool, columns [][]string) (treeStore *gtk.TreeStore)

*********************

  • TreeStore section ********************

TreeViewTreeStoreSetup: Creates a TreeView and the TreeStore that holds its data

func TruncateString

func TruncateString(inString, prefix string, max, option int) string

TruncateString: Reduce string length for display (prefix is separator like: "...", option=0 -> put separator at the begening of output string. Option=1 -> center, is where separation is placed. option=2 -> line feed, trunc the whole string using LF without shorting it. Max, is max char length of the output string.

func WindowDestroy

func WindowDestroy()

WindowDestroy is the triggered handler when closing/destroying the gui window.

Types

type AboutInfos

type AboutInfos struct {
	AppName      string
	AppVers      string
	AppCreats    string
	YearCreat    string
	LicenseAbrv  string
	LicenseShort string
	Repository   string
	Description  string

	AboutDialogBox *gtk.Window
	// contains filtered or unexported fields
}

* Aboutbox implementation

func (*AboutInfos) Hide

func (infos *AboutInfos) Hide()

func (*AboutInfos) InitFillInfos

func (ab *AboutInfos) InitFillInfos(
	TitleBox,
	AppName,
	AppVers,
	AppCreat,
	YearCreat,
	LicenseAbrv,
	LicenseShort,
	Repository,
	Description string,
	topImage,
	okBtnIcon interface{})

func (*AboutInfos) Show

func (infos *AboutInfos) Show()

type Clipboard

type Clipboard struct {
	Entity *gtk.Clipboard
}

func (*Clipboard) GetText

func (c *Clipboard) GetText() (clipboardContent string, err error)

func (*Clipboard) Init

func (c *Clipboard) Init() (err error)

Initialise clipboard

func (*Clipboard) SetText

func (c *Clipboard) SetText(clipboardContent string)

func (*Clipboard) Store

func (c *Clipboard) Store()

Stores the current clipboard data somewhere so that it will stay around after the application has quit.

type DropSet

type DropSet struct {
	Object    interface{} // gtkObject that receive DND
	FilesList []string    // Contain the files list received
	CallBack  func()      // Function called after receiving datas
}

func (*DropSet) InitDropSet

func (ds *DropSet) InitDropSet(objects interface{}, filesList []string, callBack func())

initDropSets: configure controls to receive dndcontent.

type GtkInterface

type GtkInterface struct {
	GXPVersion    string
	ObjectsCount  int
	UpdatedOn     string
	GladeFilename string
	Requires      requires
	Objects       []GtkObject
	Comments      []string
	// contains filtered or unexported fields
}

func GladeXmlParserNew

func GladeXmlParserNew(filename string, skipNoId, skipLoweAtFirst bool) (out *GtkInterface, err error)

parseGladeXmlFile: Create new parsed glade structure containing all objects with property, signals, packing informations.

func (*GtkInterface) ReadFile

func (iFace *GtkInterface) ReadFile(filename string) (err error)

Read Text Controls from file

func (*GtkInterface) WriteFile

func (iFace *GtkInterface) WriteFile(filename string) error

Write Text Controls to file

type GtkObject

type GtkObject struct {
	Class    string
	Id       string
	Property []GtkProps
	Signal   []GtkProps
	Packing  []GtkProps
}

type GtkProps

type GtkProps struct {
	Name         string
	Value        string
	Swapped      string
	Translatable string
}

type PangoColor

type PangoColor struct {
	Black     string
	Brown     string
	White     string
	Red       string
	Green     string
	Blue      string
	Cyan      string
	Magenta   string
	Purple    string
	Turquoise string
	Violet    string
	Darkred   string
	Darkgreen string
	Darkblue  string
	Darkgray  string

	Darkcyan       string
	Lightblue      string
	Lightgray      string
	Lightgreen     string
	Lightturquoise string
	Lightred       string
	Lightyellow    string
}

func (*PangoColor) Init

func (pc *PangoColor) Init()

type PangoMarkup

type PangoMarkup struct {
	InString  string
	OutString string

	Colors PangoColor
	// contains filtered or unexported fields
}

func (*PangoMarkup) AddPosition

func (pm *PangoMarkup) AddPosition(pos ...[]int)

Add multiples positions, (where markup is applied)

func (*PangoMarkup) AddTypes

func (pm *PangoMarkup) AddTypes(mType ...[]string)

Add multiples markup types, (the style applied at given positions)

func (*PangoMarkup) Init

func (pm *PangoMarkup) Init(inString string)

func (*PangoMarkup) Markup

func (pm *PangoMarkup) Markup() string

Apply multiples pango markups to the whole text.

func (*PangoMarkup) MarkupAtPos

func (pm *PangoMarkup) MarkupAtPos() string

Apply multiples pango markups to text at specified positions given into 2d slices.

type PopupMenu

type PopupMenu struct {
	WithIcons bool
	// contains filtered or unexported fields
}

func (*PopupMenu) PopupAddItem

func (p *PopupMenu) PopupAddItem(lbl string, activateFunction interface{}, icon ...interface{}) (err error)

PopupAddItem:

func (*PopupMenu) PopupAddSeparator

func (p *PopupMenu) PopupAddSeparator() (err error)

PopupAddSeparator:

func (*PopupMenu) PopupMenuBuild

func (p *PopupMenu) PopupMenuBuild() (menu *gtk.Menu, err error)

PopupMenuBuild: Build popupmenu

type StatusBar

type StatusBar struct {
	Messages []string /* Each row contain associated strings refere to contextId number */

	Prefix []string
	// contains filtered or unexported fields
}

func StatusBarNew

func StatusBarNew(originStatusbar *gtk.Statusbar, prefix []string, stackId ...int) *StatusBar

Init: Initialise structure to handle elements to be displayed.

func (*StatusBar) Add

func (bar *StatusBar) Add(prefix, inString string) (position int)

Add: add new element and return his own position.

func (*StatusBar) CleanAll

func (bar *StatusBar) CleanAll()

CleanAll: remove all elements (set to empty string) from the messages list.

func (*StatusBar) Del

func (bar *StatusBar) Del(pos int) (newLength int)

Del: remove element at defined position and get the new length of elements.

func (*StatusBar) Disp

func (bar *StatusBar) Disp()

Disp: display content of stored elements into statusbar

func (*StatusBar) Init

func (bar *StatusBar) Init(originStatusbar *gtk.Statusbar, prefix []string, stackId ...int)

Init: Initialise structure to handle elements to be displayed.

func (*StatusBar) Set

func (bar *StatusBar) Set(inString string, pos int)

Add: set element at desired position.

Jump to

Keyboard shortcuts

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