Class: MittensUi::Notify
Instance Attribute Summary
Attributes inherited from Core
Instance Method Summary collapse
-
#initialize(msg, options = {}) ⇒ Notify
constructor
A new instance of Notify.
- #render ⇒ Object
Methods inherited from Core
#hidden?, #hide, #remove, #show
Methods included from Helpers
#icon_map, #list_system_icons, #set_margin_from_opts_for
Constructor Details
#initialize(msg, options = {}) ⇒ Notify
Returns a new instance of Notify.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/mittens_ui/notify.rb', line 5 def initialize(msg, ={}) @activate_timer = [:timer] || true @notify_bar = Gtk::InfoBar.new @notify_bar.(true) msg_label = Gtk::Label.new(msg) @notify_bar. = set_msg_type() @notify_bar.content_area.pack_start(msg_label) setup_close_notification super(@notify_bar, ) end |
Instance Method Details
#render ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/mittens_ui/notify.rb', line 23 def render $vertical_box.pack_start(@notify_bar) unless $vertical_box.children.include?(@notify_bar) $vertical_box.reorder_child(@notify_bar, 0) @notify_bar.show_all trigger_notify_timer if @activate_timer return self end |