Class: MittensUi::FileMenu
Overview
A menu bar widget that renders a GTK4 popover menu bar with dropdown menus. Menu items are defined as a nested hash and automatically become callable methods on the FileMenu instance. Wraps Gtk::PopoverMenuBar backed by Gio::Menu.
Instance Attribute Summary
Attributes inherited from Core
Instance Method Summary collapse
-
#initialize(menu_items, options = {}) ⇒ FileMenu
constructor
Creates a new FileMenu widget.
Methods inherited from Core
#hidden?, #hide, #keyboard_shortcut, #remove, #remove_keyboard_shortcut, #render, #shortcuts, #show
Methods included from Helpers
#icon_map, #list_system_icons, #set_margin_from_opts_for
Constructor Details
#initialize(menu_items, options = {}) ⇒ FileMenu
Creates a new FileMenu widget.
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/mittens_ui/file_menu.rb', line 44 def initialize(, = {}) @menu_items = @raw_actions = {} @handlers = {} @action_group = Gio::SimpleActionGroup.new @gio_menu = @menu_bar = Gtk::PopoverMenuBar.new(@gio_menu) super(@menu_bar, ) end |