Class: MittensUi::Core

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/mittens_ui/core.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#icon_map, #list_system_icons, #set_margin_from_opts_for

Constructor Details

#initialize(widget, options = {}) ⇒ Core

All MittenUi::Widgets::* classes should inherit from this base class.



11
12
13
14
15
# File 'lib/mittens_ui/core.rb', line 11

def initialize(widget, options={})
  # core_widget is the Raw Gtk::Widget*
  @core_widget = widget
  set_margin_from_opts_for(@core_widget, options)
end

Instance Attribute Details

#core_widgetObject (readonly)

Returns the value of attribute core_widget.



7
8
9
# File 'lib/mittens_ui/core.rb', line 7

def core_widget
  @core_widget
end

Instance Method Details

#hidden?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/mittens_ui/core.rb', line 21

def hidden?
  @core_widget.visible?
end

#hideObject



25
26
27
28
# File 'lib/mittens_ui/core.rb', line 25

def hide
  return if @core_widget.nil?
  @core_widget.hide
end

#removeObject



30
31
32
# File 'lib/mittens_ui/core.rb', line 30

def remove
  $vertical_box.remove(@core_widget)
end

#showObject



17
18
19
# File 'lib/mittens_ui/core.rb', line 17

def show
  @core_widget.show_all
end