Class: Rabbit::Menu
- Inherits:
-
Object
- Object
- Rabbit::Menu
- Includes:
- ERB::Util, GetText
- Defined in:
- lib/rabbit/menu.rb
Constant Summary collapse
- @@icon =
nil
Constants included from GetText
Instance Method Summary collapse
- #attach(window) ⇒ Object
- #detach(window) ⇒ Object
-
#initialize(actions) ⇒ Menu
constructor
A new instance of Menu.
- #popup(button, time) ⇒ Object
- #update_menu(canvas) ⇒ Object
Methods included from GetText
Constructor Details
#initialize(actions) ⇒ Menu
Returns a new instance of Menu.
35 36 37 38 39 40 41 42 43 |
# File 'lib/rabbit/menu.rb', line 35 def initialize(actions) @merge = Gtk::UIManager.new @merge.insert_action_group(actions, 0) @jump_to_actions = nil @jump_to_merge_id = nil @theme_actions = nil @theme_merge_id = nil update_ui end |
Instance Method Details
#attach(window) ⇒ Object
45 46 47 |
# File 'lib/rabbit/menu.rb', line 45 def attach(window) window.add_accel_group(accel_group) end |
#detach(window) ⇒ Object
49 50 51 |
# File 'lib/rabbit/menu.rb', line 49 def detach(window) window.remove_accel_group(accel_group) end |
#popup(button, time) ⇒ Object
64 65 66 |
# File 'lib/rabbit/menu.rb', line 64 def popup(, time) @menu.popup(nil, nil, , time) end |
#update_menu(canvas) ⇒ Object
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/rabbit/menu.rb', line 53 def (canvas) (canvas) (canvas) Action.(canvas) Action.update_graffiti_action_status(canvas) Action.update_theme_action_status(canvas) Action.update_quit_action_status(canvas) @merge.ensure_update show_tearoff end |