librelist archives

« back to archive

stack and flow

stack and flow

From:
Per Mikaelsson
Date:
2011-11-14 @ 09:55
Howdy all,

I have a question about stack and flows.

In the small application I am trying to make I use edit_line to get input
to the program ex.

Shoes.app do
  background blue ... lightskyblue
  flow do
    stack :width => 10 do # 0.15 pixels colum from left edge
    end
    flow :width => 0.15 do # colum 30 pixels wide background green text IP
      background red ... white
        para "Host "
      end
      host_ip = edit_line
    end


  flow do
  stack :width => 10 do
  end
  flow :width => 0.15 do
    background red ... white
    para "Username "
  end
  user_name = edit_line
end

What happens is that each edit_line or rather the space between them
increases with every edit_line. So my friends what is it that I am doing
wrong here?

Shoes on

Re: [shoes] stack and flow

From:
ashbb
Date:
2011-11-14 @ 12:41
Hi Per,

Thank you for showing the code.
I added a `end` at the tail of your code and ran with Shoes 3 for Windows
and got this snapshot: http://www.rin-shun.com/tmp/snapshot20111114.png

> what is it that I am doing wrong here?
Ah,.. I don't see anything wrong, though...

Can you explain what you mean a little bit more clearly?

ashbb

Re: [shoes] stack and flow

From:
Per Mikaelsson
Date:
2011-11-14 @ 13:09
Hi ashbb,

I sure can I uploaded a img to http://fox.dyndns-at-home.com/tmp/shoes.jpg

2011/11/14 ashbb <ashbbb@gmail.com>

> Hi Per,
>
> Thank you for showing the code.
> I added a `end` at the tail of your code and ran with Shoes 3 for Windows
> and got this snapshot: http://www.rin-shun.com/tmp/snapshot20111114.png
>
>
> > what is it that I am doing wrong here?
> Ah,.. I don't see anything wrong, though...
>
> Can you explain what you mean a little bit more clearly?
>
> ashbb
>

Re: [shoes] stack and flow

From:
ashbb
Date:
2011-11-14 @ 13:46
Ahhh... confirmed with Green Shoes on my Windows 7.
You've found a bug!

Thank you for letting me know. I'll debug Green Shoes asap.

ashbb

Re: [shoes] stack and flow

From:
Per Mikaelsson
Date:
2011-11-14 @ 13:52
Ohh

And here I was thinking I am so stupid cant get them to space properly :)

2011/11/14 ashbb <ashbbb@gmail.com>

> Ahhh... confirmed with Green Shoes on my Windows 7.
> You've found a bug!
>
> Thank you for letting me know. I'll debug Green Shoes asap.
>
> ashbb
>
>

Re: [shoes] stack and flow

From:
ashbb
Date:
2011-11-15 @ 11:40
Hi Per,

The following is a patch to solve the problem you found.

green_shoes/lib/shoes/helper_methods.rb, line 181

before:
  slot_height = flag ? [slot_height, y].max : slot_height + max.height

after:
  slot_height += max.height

After doing some more tests, I'll update the github repo of Green Shoes.
If you have time, try out the above patch. ;-)

ashbb

Re: [shoes] stack and flow

From:
ashbb
Date:
2011-11-15 @ 14:23
Hi Per and folks,

Updated Green Shoes. Try out the latest on github. ;-)

ashbb