Documentation ¶
Index ¶
- Variables
- func CssWdgScnBytes(data []byte, wdgt ...*gtk.Widget) (err error)
- func CssWdgScnLoad(filename string, wdgt ...*gtk.Widget) (err error)
- func Notify(title, text string)
- type Clipboard
- type DragNDropStruct
- type ItemOptionsType
- type PopupMenuIconStruct
- func (pop *PopupMenuIconStruct) AddItem(lbl string, activateFunction interface{}, options ...interface{}) (widgetIdx int, err error)
- func (pop *PopupMenuIconStruct) AppendToExistingMenu(menu *gtk.Menu) *gtk.Menu
- func (pop *PopupMenuIconStruct) CheckRMB(obj interface{}, event *gdk.Event) bool
- func (pop *PopupMenuIconStruct) CheckRMBFromTreeView(tv *gtk.TreeView, event *gdk.Event) bool
- func (pop *PopupMenuIconStruct) GetCheckButtonCurrent() *gtk.CheckButton
- func (pop *PopupMenuIconStruct) GetIWidgetIdx(idx int) gtk.IWidget
- func (pop *PopupMenuIconStruct) GetLabelCurrent() *gtk.Label
- func (pop *PopupMenuIconStruct) GetMenuItemCurrent() *gtk.MenuItem
- func (pop *PopupMenuIconStruct) GetMenuItemIdx(idx int) *gtk.MenuItem
- func (pop *PopupMenuIconStruct) GetRadioButtonCurrent() *gtk.RadioButton
- func (pop *PopupMenuIconStruct) GetSeparatorMenuItemCurrent() *gtk.SeparatorMenuItem
- func (pop *PopupMenuIconStruct) MenuBuild() *gtk.Menu
- type PopupMenuStruct
- func (pop *PopupMenuStruct) AddItem(lbl string, activateFunction interface{}, options ...interface{}) (widgetIdx int, err error)
- func (pop *PopupMenuStruct) AppendToExistingMenu(menu *gtk.Menu) *gtk.Menu
- func (pop *PopupMenuStruct) CheckRMB(obj interface{}, event *gdk.Event) bool
- func (pop *PopupMenuStruct) CheckRMBFromTreeView(tv *gtk.TreeView, event *gdk.Event) bool
- func (pop *PopupMenuStruct) GetCheckMenuItemCurrent() *gtk.CheckMenuItem
- func (pop *PopupMenuStruct) GetIMenuItemIdx(idx int) gtk.IMenuItem
- func (pop *PopupMenuStruct) GetMenuItemCurrent() *gtk.MenuItem
- func (pop *PopupMenuStruct) GetRadioMenuItemCurrent() *gtk.RadioMenuItem
- func (pop *PopupMenuStruct) GetSeparatorMenuItemCurrent() *gtk.SeparatorMenuItem
- func (pop *PopupMenuStruct) MenuBuild() *gtk.Menu
- type ProgressBarStruct
- 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)
- func (bar *StatusBar) Show(state bool)
- type TitleBar
Constants ¶
This section is empty.
Variables ¶
var ( HexToBytes = gipf.HexToBytes GetPixBuf = gipf.GetPixBuf )
Functions ¶
func CssWdgScnLoad ¶
CssWidgetLoad: Load or read from data and apply css to widget if it's provided. Apply to screen otherwise.
Types ¶
type Clipboard ¶
func ClipboardNew ¶
ClipboardNew: Create new clipboard structure
type DragNDropStruct ¶
type DragNDropStruct struct { // gtkObject that receive DND Object interface{} // Contain the files list received FilesList *[]string // contains filtered or unexported fields }
func DragNDropNew ¶
func DragNDropNew(objects interface{}, filesList *[]string, callBackRecieveDone func(), callBackOnRecieve ...func(item interface{}, context *gdk.DragContext) bool) *DragNDropStruct
DragNDropNew: configure controls to receive dndcontent. "filesList" can be "nil"
type ItemOptionsType ¶
type ItemOptionsType int
const ( // Like GtkMenuItem ITEM_OPT_NORMAL ItemOptionsType = 1 << 0 // Like GtkCheckMenuItem ITEM_OPT_CHECK ItemOptionsType = 1 << 1 // Like GtkRadioMenuItem ITEM_OPT_RADIO ItemOptionsType = 1 << 2 // Like GtkSeparatorMenuItem ITEM_OPT_SEPARATOR ItemOptionsType = 1 << 3 // Add icon before GtkMenuItem ITEM_OPT_ICON ItemOptionsType = 1 << 4 // Disable the use of mnemonic ITEM_OPT_NO_MNEMONIC ItemOptionsType = 1 << 5 // Start a new group for GtkRadioButton(s) ITEM_OPT_RADIO_NEW_GRP ItemOptionsType = 1 << 6 // align label to other (adding blank icon) ITEM_OPT_ALGN_LBL ItemOptionsType = 1 << 7 // Box container alignement centered ITEM_OPT_ALGN_BOX_CNTR ItemOptionsType = 1 << 8 )
type PopupMenuIconStruct ¶
type PopupMenuIconStruct struct { Menu *gtk.Menu // Indicate what type of function the window has. WindowTypeHint gdk.WindowTypeHint // default (WINDOW_TYPE_HINT_POPUP_MENU) // left mouse button instead of right LMB, ReserveToggleSize bool // Define icons size IconsSize, BoxSpacing, TreeViewMinSelectedRows int // Options that can be used with designed function OPT_NORMAL, OPT_CHECK, OPT_RADIO, OPT_SEPARATOR, OPT_ICON, OPT_NO_MNEMONIC, OPT_RADIO_NEW_GRP, OPT_ALGN_LBL, OPT_ALGN_BOX_CNTR ItemOptionsType // contains filtered or unexported fields }
- Icon version, this structure hold a home-made version of GtkMenu with Icon
- handling. Since Gtk3 does not include icon possibility anymore, i've made
- this implementation to continue using icons in my menu.
- - GtkMenuItem is replaced by a GtkBox which embeds a GtkLabel, everything will be embedded in a GtkMenuItem.
- - GtkCheckMenuItem is replaced by a GtkBox which embeds a GtkCheckButton, everything will be embedded in a GtkMenuItem.
- - GtkRadioMenuItem is replaced by a GtkBox which embeds a GtkRadioButton, everything will be embedded in a GtkMenuItem.
- - GtkSeparatorMenuItem still untouched.
- Note: for Icon, each GtkBox may embed/or not a GtkImage at first.
- The "signal" emitted by the objects is processed transparently.
- All objects are accessible using they own method just after
* creation or later, using they indexes and respective methods.
PopupMenuIconStruct: Structure that hold popup menu options and methods. A simple builder for popup menu that may handle icons. Instead of classics GtkMenuItem, this structure use: - GtkLabel as GtkMenuItem, it will be embedded in a GtkMenuItem - GtkCheckButton as GtkCheckMenuItem, it will be embedded in a GtkMenuItem - GtkRadioButton as GtkRadioMenuItem, it will be embedded in a GtkMenuItem To get the active widget, you can use 'GetXXXCurrent' or 'GetXXXIdx' method Note: the "toggled" signal is handled as transparent as possible.
func PopupMenuIconStructNew ¶
func PopupMenuIconStructNew() (pop *PopupMenuIconStruct)
PopupMenuNew: return a new PopupMenuIconStruct structure
func (*PopupMenuIconStruct) AddItem ¶
func (pop *PopupMenuIconStruct) AddItem( lbl string, activateFunction interface{}, options ...interface{}) (widgetIdx int, err error)
AddItem: Add item to menu. This version handle checkbutton/radiobutton with groups and classic labels with or without icon and more options ...
func (*PopupMenuIconStruct) AppendToExistingMenu ¶
func (pop *PopupMenuIconStruct) AppendToExistingMenu(menu *gtk.Menu) *gtk.Menu
func (*PopupMenuIconStruct) CheckRMB ¶
func (pop *PopupMenuIconStruct) CheckRMB(obj interface{}, event *gdk.Event) bool
CheckRMB: Check whether an event comes from the right button of the mouse and display the popup if it is the case at the mouse position.
func (*PopupMenuIconStruct) CheckRMBFromTreeView ¶
CheckRMBFromTreeView: May be directly used as callback function for TreeView' "button-press-event" signal, considere to initialize the popup menu before setting this function as callback. Otherwise, the call will generate error "nil pointer ..."
func (*PopupMenuIconStruct) GetCheckButtonCurrent ¶
func (pop *PopupMenuIconStruct) GetCheckButtonCurrent() *gtk.CheckButton
Retrieve current undferlayed GtkCheckButton
func (*PopupMenuIconStruct) GetIWidgetIdx ¶
func (pop *PopupMenuIconStruct) GetIWidgetIdx(idx int) gtk.IWidget
Retrieve the underlayed IWidget at 'idx'
func (*PopupMenuIconStruct) GetLabelCurrent ¶
func (pop *PopupMenuIconStruct) GetLabelCurrent() *gtk.Label
Retrieve current undferlayed GtkLabel
func (*PopupMenuIconStruct) GetMenuItemCurrent ¶
func (pop *PopupMenuIconStruct) GetMenuItemCurrent() *gtk.MenuItem
Retrieve current GtkMenuItem
func (*PopupMenuIconStruct) GetMenuItemIdx ¶
func (pop *PopupMenuIconStruct) GetMenuItemIdx(idx int) *gtk.MenuItem
Get the MenuItem at 'idx', which contains underlying widgets
func (*PopupMenuIconStruct) GetRadioButtonCurrent ¶
func (pop *PopupMenuIconStruct) GetRadioButtonCurrent() *gtk.RadioButton
Retrieve current undferlayed GtkRadioButton
func (*PopupMenuIconStruct) GetSeparatorMenuItemCurrent ¶
func (pop *PopupMenuIconStruct) GetSeparatorMenuItemCurrent() *gtk.SeparatorMenuItem
Retrieve current GtkSeparatorMenuItem
func (*PopupMenuIconStruct) MenuBuild ¶
func (pop *PopupMenuIconStruct) MenuBuild() *gtk.Menu
MenuBuild: Build popupmenu.
type PopupMenuStruct ¶
type PopupMenuStruct struct { Menu *gtk.Menu // Indicate what type of function the window has. WindowTypeHint gdk.WindowTypeHint // default (WINDOW_TYPE_HINT_POPUP_MENU) // left mouse button instead of right LMB, ReserveToggleSize bool // space separator for box (used when image is present) BoxSpacing, TreeViewMinSelectedRows int // Options that can be used with designed function OPT_NORMAL, OPT_CHECK, OPT_RADIO, OPT_SEPARATOR, OPT_NO_MNEMONIC, OPT_RADIO_NEW_GRP ItemOptionsType // contains filtered or unexported fields }
PopupMenuStruct: means that only standard widgets will be used If you want to add icons, prefere using next structure 'PopupMenuIconStruct'
func PopupMenuStructNew ¶
func PopupMenuStructNew() (pop *PopupMenuStruct)
PopupMenuNew: return a new PopupMenuStruct structure
func (*PopupMenuStruct) AddItem ¶
func (pop *PopupMenuStruct) AddItem( lbl string, activateFunction interface{}, options ...interface{}) (widgetIdx int, err error)
AddItem: Add item to menu. This version handle checkbutton/radiobutton with groups and classic labels
func (*PopupMenuStruct) AppendToExistingMenu ¶
func (pop *PopupMenuStruct) AppendToExistingMenu(menu *gtk.Menu) *gtk.Menu
AppendToExistingMenu: append "MenuItems" to an existing "*gtk.Menu" Useful when you want to just add some entries to the context menu that already exist in a gtk.TextView or gtk.Entry by using "populate-popup" signal. Notice: GtkWidget > GtkMenu: menu := >k.Menu{gtk.MenuShell{gtk.Container{*w}}} Each connection to signal need to re-create the entire menu.
func (*PopupMenuStruct) CheckRMB ¶
func (pop *PopupMenuStruct) CheckRMB(obj interface{}, event *gdk.Event) bool
CheckRMB: Check whether an event comes from the right button of the mouse and display the popup if it is the case at the mouse position.
func (*PopupMenuStruct) CheckRMBFromTreeView ¶
CheckRMBFromTreeView: May be directly used as callback function for TreeView' "button-press-event" signal, considere to initialize the popup menu before setting this function as callback. Otherwise, the call will generate error "nil pointer ..." NOTE: "button-press-event" signal instead of "button-release-event" must be used to avoid deselecting rows on right click.
func (*PopupMenuStruct) GetCheckMenuItemCurrent ¶
func (pop *PopupMenuStruct) GetCheckMenuItemCurrent() *gtk.CheckMenuItem
Retrieve current GtkCheckMenuItem
func (*PopupMenuStruct) GetIMenuItemIdx ¶
func (pop *PopupMenuStruct) GetIMenuItemIdx(idx int) gtk.IMenuItem
Retrieve the IMenuItem at 'idx' NOTE: Require type assertion!!!
func (*PopupMenuStruct) GetMenuItemCurrent ¶
func (pop *PopupMenuStruct) GetMenuItemCurrent() *gtk.MenuItem
Retrieve current GtkMenuItem
func (*PopupMenuStruct) GetRadioMenuItemCurrent ¶
func (pop *PopupMenuStruct) GetRadioMenuItemCurrent() *gtk.RadioMenuItem
Retrieve current GtkRadioMenuItem
func (*PopupMenuStruct) GetSeparatorMenuItemCurrent ¶
func (pop *PopupMenuStruct) GetSeparatorMenuItemCurrent() *gtk.SeparatorMenuItem
Retrieve current GtkSeparatorMenuItem
func (*PopupMenuStruct) MenuBuild ¶
func (pop *PopupMenuStruct) MenuBuild() *gtk.Menu
MenuBuild: Build popupmenu.
type ProgressBarStruct ¶
type ProgressBarStruct struct { RefreshMs uint GifImageName string TimeOutContinue bool // contains filtered or unexported fields }
func ProgressBarNew ¶
func ProgressBarNew(progressBar *gtk.ProgressBar) (pbs *ProgressBarStruct)
ProgressBarNew: creat a new 'ProgressBarStruct'
func ProgressGifNew ¶
func ProgressGifNew(varPath interface{}, box *gtk.Box, position int) (pbs *ProgressBarStruct)
ProgressGifNew: create 'ProgressBarStruct' frome given information. Note: 'varPath' could be []byte, filename or *gtk.Image
func (*ProgressBarStruct) Init ¶
func (pbs *ProgressBarStruct) Init(fMain, fEnd func() error)
Init: structure initialization with start and end callback functions.
func (*ProgressBarStruct) StartGif ¶
func (pbs *ProgressBarStruct) StartGif() (err error)
StartGif: launch progressbar as gif animated image.
func (*ProgressBarStruct) StartTicker ¶
func (pbs *ProgressBarStruct) StartTicker() (err error)
StartTicker: start gtk progressbar using golang ticker function.
func (*ProgressBarStruct) StartTimeOut ¶
func (pbs *ProgressBarStruct) StartTimeOut() (err error)
StartTimeOut: start gtk progressbar using 'glib.TimeoutAdd' command
type StatusBar ¶
type StatusBar struct { Messages []string /* Each row contain associated strings refere to contextId number */ Separator string Prefix []string // contains filtered or unexported fields }
func StatusBarStructureNew ¶
func StatusBarStructureNew(originStatusbar *gtk.Statusbar, prefix []string, stackId ...int) (bar *StatusBar)
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
type TitleBar ¶
type TitleBar struct { MainTitle string Separator string // contains filtered or unexported fields }