ashbb / green_shoes

Green Shoes is one of the colorful Shoes written in pure Ruby.
Other
204 stars 37 forks source link

remove method on Image gives GTK error on STDOUT #51

Open translunar opened 12 years ago

translunar commented 12 years ago

I have a similar problem to the one described here:

http://librelist.com/browser//shoes/2011/3/3/green-shoes-error-on-stdout-when-trying-to-clear-a-flow/#7fe6a7ed1f69f7d0b9827ad90fb4808d

It happens when I attempt to remove an image:

Shoes.app :title => "Test" do
  update = File.mtime(file)
  img = image(file)

  # If image is updated, reload it.
  every(2) do
    new_time = File.mtime(file)
    unless new_time == update
      img.remove
      update  = new_time
      img     = image(file)
    end
  end
end

Still learning GTK -- tried to figure out the problem, but just don't know enough yet.

Cheers, John

translunar commented 12 years ago

Workaround is img.real.clear, but that may create a memory leak.

ashbb commented 12 years ago

Hi John, Thank you for the information. Yeah, remove method is not so good. I need to study GTK more. Try out to use img.clear instead of img.remove for now. ;-) ashbb