Class: Fidgit::MainPacker

Inherits:
Vertical show all
Defined in:
lib/fidgit/elements/main_packer.rb

Overview

Main container that can contains a single “proper” packing element.

Constant Summary

Constants inherited from Element

Element::DEFAULT_SCHEMA_FILE, Element::VALID_ALIGN_H, Element::VALID_ALIGN_V

Instance Attribute Summary

Attributes inherited from Grid

#num_columns, #num_rows, #type

Attributes inherited from Packer

#spacing_h, #spacing_v

Attributes inherited from Element

#align_h, #align_v, #background_color, #border_thickness, #font, #padding_bottom, #padding_left, #padding_right, #padding_top, #parent, #tip, #z

Instance Method Summary collapse

Methods inherited from Container

#button, #clear, #color_picker, #color_well, #combo_box, #file_browser, #grid, #group, #hit_element, #horizontal, #image_frame, #insert, #label, #list, #radio_button, #remove, #scroll_area, #scroll_window, #slider, #text_area, #to_s, #toggle_button, #update, #vertical, #write_tree, #x=, #y=

Methods inherited from Element

#default, #drag?, #draw, #draw_frame, #draw_rect, #enabled=, #enabled?, #hit?, #max_height, #max_width, #min_height, #min_width, new, original_new, #outer_height, #outer_width, #recalc, schema, #to_s, #update, #with, #x, #x=, #y, #y=

Methods included from Event

#events, included, new_event_handlers, #publish, #subscribe, #unsubscribe

Constructor Details

#initialize(options = {}) ⇒ MainPacker

Returns a new instance of MainPacker.



6
7
8
9
10
11
12
13
# File 'lib/fidgit/elements/main_packer.rb', line 6

def initialize(options = {})
  options = {
      width: $window.width,
      height: $window.height,
  }.merge! options

  super options
end

Instance Method Details

#add(element) ⇒ Object



20
21
22
23
# File 'lib/fidgit/elements/main_packer.rb', line 20

def add(element)
  raise "MainPacker can only contain packing elements" unless element.is_a? Packer
  super(element)
end

#heightObject



16
# File 'lib/fidgit/elements/main_packer.rb', line 16

def height; $window.height; end

#height=(value) ⇒ Object



18
# File 'lib/fidgit/elements/main_packer.rb', line 18

def height=(value); ; end

#widthObject



15
# File 'lib/fidgit/elements/main_packer.rb', line 15

def width; $window.width; end

#width=(value) ⇒ Object



17
# File 'lib/fidgit/elements/main_packer.rb', line 17

def width=(value); ; end