Documentation ¶
Overview ¶
Package menus builds gtk menus.
Index ¶
- type ButtonsEntry
- type CallNewItem
- type CallNewSubMenu
- type Check
- type Item
- type Menu
- func (menu *Menu) AddButtonsEntry(label string) *ButtonsEntry
- func (menu *Menu) AddCheckEntry(label string, active bool, call interface{}, userData ...interface{}) (item *gtk.CheckMenuItem)
- func (menu *Menu) AddEntry(label, iconPath string, call interface{}, userData ...interface{}) *gtk.MenuItem
- func (menu *Menu) AddList(items ...interface{})
- func (menu *Menu) AddRadioEntry(label string, active bool, groupID int, call interface{}, ...) (item *gtk.RadioMenuItem)
- func (menu *Menu) AddSeparator()
- func (menu *Menu) AddSubMenu(title, iconPath string) *Menu
- func (menu *Menu) AddSubMenuWrapped(title string, gtkmenu *gtk.Menu)
- func (menu *Menu) SetCallNewItem(call CallNewItem)
- func (menu *Menu) SetCallNewSubMenu(call CallNewSubMenu)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ButtonsEntry ¶
type ButtonsEntry struct { gtk.MenuItem // extends MenuItem, the main widget. // contains filtered or unexported fields }
ButtonsEntry defines a menu entry with buttons inside.
func NewButtonsEntry ¶
func NewButtonsEntry(text string) *ButtonsEntry
NewButtonsEntry creates a menu entry with buttons management.
type CallNewItem ¶
CallNewItem defines a func that creates a menu item and packs it to the menu.
type CallNewSubMenu ¶
CallNewSubMenu defines a func that creates a submenu and packs it to the menu.
type Item ¶
type Item struct { Title string Call interface{} }
Item defines a simple entry description with Title and an optional argument.
Call can be of type:
nil visible but disabled option (can't be clicked). func() callback to connect to the activate event. []interface{} list of items for a submenu. Recursive call so the same options are allowed.
type Menu ¶
Menu builds gtk menus. Can be loaded manually or using MenuNewAttached.
func NewMenu ¶
func NewMenu(items ...interface{}) *Menu
NewMenu creates a gtk menu builder.
Warning, don't forget to use ShowAll when you add entries manually.
func (*Menu) AddButtonsEntry ¶
func (menu *Menu) AddButtonsEntry(label string) *ButtonsEntry
AddButtonsEntry adds a button entry to the menu.
func (*Menu) AddCheckEntry ¶
func (menu *Menu) AddCheckEntry(label string, active bool, call interface{}, userData ...interface{}) (item *gtk.CheckMenuItem)
AddCheckEntry adds a check entry to the menu.
func (*Menu) AddEntry ¶
func (menu *Menu) AddEntry(label, iconPath string, call interface{}, userData ...interface{}) *gtk.MenuItem
AddEntry adds an item to the menu with its callback.
func (*Menu) AddList ¶
func (menu *Menu) AddList(items ...interface{})
AddList adds a list of custom entries to the menu.
items can be of type:
nil : a separator. Check : a checkable entry. Item : a simple entry with Title and an optional argument.
func (*Menu) AddRadioEntry ¶
func (menu *Menu) AddRadioEntry(label string, active bool, groupID int, call interface{}, userData ...interface{}) (item *gtk.RadioMenuItem)
AddRadioEntry adds a radio entry to the menu.
func (*Menu) AddSeparator ¶
func (menu *Menu) AddSeparator()
AddSeparator adds a separator to the menu.
func (*Menu) AddSubMenu ¶
AddSubMenu adds a submenu to the menu.
func (*Menu) AddSubMenuWrapped ¶
AddSubMenuWrapped adds the provided gtk menu as submenu.
func (*Menu) SetCallNewItem ¶
func (menu *Menu) SetCallNewItem(call CallNewItem)
SetCallNewItem overrides the menu item creation and packing method.
func (*Menu) SetCallNewSubMenu ¶
func (menu *Menu) SetCallNewSubMenu(call CallNewSubMenu)
SetCallNewSubMenu overrides the submenu creation and packing method.