Documentation
¶
Index ¶
- Variables
- func ComboBoxTextFill(cbxEntry *gtk.ComboBoxText, entries []string, removAll ...bool)
- func ComboBoxTextGetEntry(cbxEntry *gtk.ComboBoxText) string
- func DlgMessage(window *gtk.Window, dlgType, title, text string, iconFileName interface{}, ...) (value int)
- func FileChooser(window *gtk.Window, dlgType, title, filename string, options ...bool) (outFilename string, result bool, err error)
- func FlipImage(varPath interface{}, horizontal bool) (outPixbuf *gdk.Pixbuf, err error)
- func GetOsLineEnd() string
- func GetStrIndex2dCol(slice [][]string, value string, col int) int
- func GetTextEOL(inTextBytes []byte) (outString string)
- func HexToBytes(varPath string, gzipData []byte) (outByte []byte)
- func JsonRead(filename string, interf interface{}) (err error)
- func JsonWrite(filename string, interf interface{}) (err error)
- func ListStoreAddRow(listStore *gtk.ListStore, row []string) (iter *gtk.TreeIter)
- func LowercaseAtFirst(inString string) bool
- func MarkupHttpClickable(inString string) (outString string)
- func NormalizeSize(oldWidth, oldHeight, newValue, format int) (outWidth, outHeight int)
- func Notify(title, text string)
- func ResizeImage(varPath interface{}, width, height int, interp ...int) (outPixbuf *gdk.Pixbuf, err error)
- func RotateImage(varPath interface{}, angle gdk.PixbufRotation) (outPixbuf *gdk.Pixbuf, err error)
- func SetButtonImage(object *gtk.Button, varPath interface{}, size ...int)
- func SetImage(object *gtk.Image, varPath interface{}, size ...int)
- func SetToggleButtonImage(object *gtk.ToggleButton, varPath interface{}, size ...int)
- func SetWinIcon(object *gtk.Window, varPath interface{}, size ...int)
- func SpinbuttonSetValues(sb *gtk.SpinButton, min, max, value int, step ...int) (err error)
- func TEST_TreeStore(treeStore *gtk.TreeStore)
- func TimeStamp() *timeStamp
- func TreeStoreAddRow(treeStore *gtk.TreeStore, row string) *gtk.TreeIter
- func TreeStoreAddSubRow(treeStore *gtk.TreeStore, iter *gtk.TreeIter, row ...string) *gtk.TreeIter
- func TreeViewCreateTextColumn(title string, id int, cellAttributes []string, editable ...bool) *gtk.TreeViewColumn
- func TreeViewGetRowsNb(tw *gtk.TreeView, ls *gtk.ListStore) (rowsNb []int)
- func TreeViewListStoreSetup(treeView *gtk.TreeView, multiSelect bool, columns [][]string, editable ...bool) (listStore *gtk.ListStore)
- func TreeViewTreeStoreSetup(treeView *gtk.TreeView, multiSelect bool, columns [][]string) (treeStore *gtk.TreeStore)
- func TruncateString(inString, prefix string, max, option int) string
- func WindowDestroy()
- type AboutInfos
- type Clipboard
- type DropSet
- type GtkInterface
- type GtkObject
- type GtkProps
- type PangoColor
- type PangoMarkup
- type PopupMenu
- type StatusBar
- func (bar *StatusBar) Add(prefix, inString string) (position int)
- func (bar *StatusBar) CleanAll()
- func (bar *StatusBar) Del(pos int) (newLength int)
- func (bar *StatusBar) Disp()
- func (bar *StatusBar) Init(originStatusbar *gtk.Statusbar, prefix []string, stackId ...int)
- func (bar *StatusBar) Set(inString string, pos int)
Constants ¶
This section is empty.
Variables ¶
var Creat = "H.F.M"
var Descr = "Golang parser for glade xml files"
var FileChooserAction = map[string]gtk.FileChooserAction{ "create-folder": gtk.FILE_CHOOSER_ACTION_CREATE_FOLDER, "open": gtk.FILE_CHOOSER_ACTION_OPEN, "save": gtk.FILE_CHOOSER_ACTION_SAVE, "select-folder": gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER, }
var LicenseAbrv = "License (MIT)"
var LicenseShort = "" /* 140-byte string literal not displayed */
var LicenseUrl = "https://opensource.org/licenses/mit-license.php"
var Name = "GladeXmlParser"
var Repository = "github.com/..."
var Vers = "v2.0"
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 ¶
FlipImage: Get Flipped gtk.Pixbuff image representation from file or []byte, depending on type
func GetStrIndex2dCol ¶
GetStrIndex2dCol: Search in 2d string slice if a column's value exist and return row number.
func GetTextEOL ¶
GetTextEOL: Get EOL from text bytes (CR, LF, CRLF) > string or get OS line end.
func HexToBytes ¶
HexToBytes: Convert Gzip Hex to []byte used for embedded binary in source code
func JsonRead ¶
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 ¶
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 ¶
ListStoreAddRow: Append a row to the listStore
func LowercaseAtFirst ¶
LowercaseAtFirst: true if 1st char is lowercase (Exist into GenLib too !)
func MarkupHttpClickable ¶
MarkupHttpClickable:
func NormalizeSize ¶
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 ¶
setButtonImage: Set Icon to GtkButton objects
func SetToggleButtonImage ¶
func SetToggleButtonImage(object *gtk.ToggleButton, varPath interface{}, size ...int)
setToggleButtonImage: Set Icon to GtkToggleButton objects
func SetWinIcon ¶
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 ¶
TEST purpose with pango markup style
func TreeStoreAddRow ¶
TreeStoreAddRow: Append a toplevel row to the tree store for the tree view
func TreeStoreAddSubRow ¶
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 ¶
*********************
- 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 ¶
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 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 ¶
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 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 ¶
PopupAddSeparator:
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 ¶
Init: Initialise structure to handle elements to be displayed.
func (*StatusBar) CleanAll ¶
func (bar *StatusBar) CleanAll()
CleanAll: remove all elements (set to empty string) from the messages list.
func (*StatusBar) Disp ¶
func (bar *StatusBar) Disp()
Disp: display content of stored elements into statusbar