Method: AbstractLayout#add_with_weight

Defined in:
lib/canis/core/include/layouts/abstractlayout.rb

#add_with_weight(item, weight) ⇒ Object

Add a component, giving a weightage for height if wt is >= 1 then it is absolute height, else if between 0 and 1 , it is a percentage.

Parameters:

  • give (Fixnum, Float)

    absolute weight, or fraction of layouts height



93
94
95
96
97
# File 'lib/canis/core/include/layouts/abstractlayout.rb', line 93

def add_with_weight item, weight
  @components ||= []
  @components << item
  cfg[item][:weight] = weight
end