Permalink
Browse files

version 0.1.12

  • Loading branch information...
andrea@VEGETA andrea@VEGETA
andrea@VEGETA authored and andrea@VEGETA committed Nov 4, 2009
1 parent 1415563 commit 15db743b34384b5c7ad3066c6cbb6a2ea947758f
Showing with 4 additions and 7 deletions.
  1. +1 −1 Rakefile
  2. +3 −6 lib/freightrain/rubygnome_extensions/gtk_layout.rb
View
@@ -9,7 +9,7 @@ require 'rake/testtask'
spec = Gem::Specification.new do |s|
s.name = 'freightrain'
- s.version = '0.1.11'
+ s.version = '0.1.12'
s.has_rdoc = false
s.summary = 'ruby desktop development made easy'
s.description = s.summary
@@ -40,7 +40,8 @@ module Gtk
class Layout
def elements=(enumerable)
- delta = enumerable.length - @elements.length
+ delta = enumerable.length - @elements.length
+ @height_factor = @control.new.control.height_request unless @height_factor
height = @elements.length
delta.abs.times do
if delta > 0
@@ -55,11 +56,7 @@ def elements=(enumerable)
self.remove(@elements.pop.control)
end
end
- first_element = @elements.first
- self.height = @elements.length * first_element.control.height_request if first_element
- p @elements.length
- p @elements.length * first_element.control.height_request if first_element
- p self.height
+ self.height = @elements.length * @height_factor
(0..enumerable.length).each do |index|
@elements[index].value = enumerable[index]
end

0 comments on commit 15db743

Please sign in to comment.