librelist archives

« back to archive

green shoes error on STDOUT when trying to clear a flow.

green shoes error on STDOUT when trying to clear a flow.

From:
Catsquotl
Date:
2011-03-03 @ 13:11
The code below gives the following error.
[error]-------------------------------------
c:/ruby192/lib/ruby/gems/1.9.1/gems/green_shoes-0.171.0/lib/shoes/helper_methods
.rb: line 133
    Gtk-CRITICAL **:gtk_container_remove: assertion `GTK_IS_TOOLBAR 
(container) |
| widget->parent == GTK_WIDGET (container)' failed
[/error]----------------------------------------

I think that the flow @fwin2 somehow does not get cleared... The buttons 
do get overwritten though. some of the csv files give more buttons than 
others. so i just saw it when i noticed a few buttons remained unchanged..

[code]-----------------------------------------
require 'green_shoes'
require './zangfu'
Shoes.app title:"Shu Ha Ri", width: 1024, height: 768 do

fwin1 = flow width: 0.5, height: 0.3 do
     background khaki
     list = Dir.glob("./data/*.csv")
     list.each do|x|
         para link("#{x}"){@fwin2.clear {a = ZangFu.new
             a.set_punten(x)
                 a.punten.each {|e|
                     button e.afk, :height =>30, :width =>50  do
                     @fwin4.clear{ para strong("Afkorting:"),"#{e.afk}\n",
                     strong("Naam\t:")," #{e.name}\n",
                     strong("Locatie\t:")," #{e.locatie}\n",
                     strong("Aard\t:")," #{e.aard}\n",
                     strong("Actie\t:")," #{e.actie}\n"}
                     end
                 }

         }}
     end
     end

@fwin2 = flow width: 0.5,height: 0.3 do
end

@fwin3 = flow width: 0.5,height: 0.7 do
     para "ook zoiets"
end

@fwin4 = flow width: 0.5,height: 0.7 do
     para "blabla"
end
end
[/code]----------------------------------------------------------

Eelco

Re: [shoes] green shoes error on STDOUT when trying to clear a flow.

From:
ashbb
Date:
2011-03-03 @ 15:56
Hi Eelco,

I fetched Catsquotl/tcm-study from github and confirmed your problem.

The following is a monkey patch.

[patch]
- Replace line 132 of helper_methods.rb to

  if e.real and !e.is_a?(Pattern) and !e.hided and !e.is_a?(Button)

Just add `and !e.is_a?(Button)` condition only.
I think your helper_methods.rb is this:

c:/ruby192/lib/ruby/gems/1.9.1/gems/green_shoes-0.171.0/lib/shoes/helper_methods.rb

This is a monkey patch. So, I'll do some tests and if it's okay, I'll merge
it to my github repo.

If possible, try it out please. ;-)

Cheers,
ashbb

Re: [shoes] green shoes error on STDOUT when trying to clear a flow.

From:
Catsquotl
Date:
2011-03-04 @ 07:43
Hi Ashbb

Yes this seems to work..
Although.. I tried making the buttons links....
The links get repainted and they seem to clear, but after the 
Blaas.csv(the most buttons or links) if you hover over the space where 
blaas links have been the reappear. That is after they should and seem 
to have been replaced?

Isn't that a funny side effect..
I wish i could help out in fixing some of this..But after looking at 
some of the source....It just does not make that much sence to me yet.

Eelco
-----------------------------
fwin1 = flow width: 0.5, height: 0.3 do
     background khaki
     list = Dir.glob("./data/*.csv")
     list.each do|x|
         para link("#{x}"){@fwin2.clear {a = ZangFu.new
             a.set_punten(x)
             a.punten.each {|e|
                 para link e.afk,do #:height =>30, :width =>50  do
                     @fwin4.clear{para strong("Afkorting\t:")," #{e.afk}\n",
                         strong("Ch. naam\t:")," #{e.chname}\n",
                         strong("Naam\t:")," #{e.name}\n",
                         strong("Locatie\t:")," #{e.locatie}\n",
                         strong("Aard\t:")," #{e.aard}\n",
                         strong("Actie\t:")," #{e.actie}\n"}
                 end
             }
         }}
     end
     end
------------------------------------------------------------------
Op 3-3-2011 16:56, ashbb schreef:
> Hi Eelco,
>
> I fetched Catsquotl/tcm-study from github and confirmed your problem.
>
> The following is a monkey patch.
>
> [patch]
> - Replace line 132 of helper_methods.rb to
>
>   if e.real and !e.is_a?(Pattern) and !e.hided and !e.is_a?(Button)
>
> Just add `and !e.is_a?(Button)` condition only.
> I think your helper_methods.rb is this: 
> 
c:/ruby192/lib/ruby/gems/1.9.1/gems/green_shoes-0.171.0/lib/shoes/helper_methods.rb
>
> This is a monkey patch. So, I'll do some tests and if it's okay, I'll 
> merge it to my github repo.
>
> If possible, try it out please. ;-)
>
> Cheers,
> ashbb

Re: [shoes] green shoes error on STDOUT when trying to clear a flow.

From:
ashbb
Date:
2011-03-04 @ 13:08
Hi Eelco,

Thank you for testing Green Shoes. :)

> Yes this seems to work..
Thank you for confirming. But I noticed this patch was not good. xx-P

Try out the following patch:

- add this line:
        @real = nil
  between line 83 and 84 in basic.rb


> if you hover over the space where blaas links have been the reappear.
Ah, you found another bug. ;-)

Try out the following patch:

- add this line:
        contents.each{|e| @app.mlcs.delete e}
  between line 69 and 70 in slot.rb

I'm going to do some more tests and upload the above patched to my github
repo.

Thanks,
ashbb