On 18.11.2008, at 00:37 , _why wrote:

On Mon, Nov 17, 2008 at 11:58:36PM +0000, Einar Magnús Boson wrote:
How can I let my widget know the size of its parent? Since it doesn't
reflow the size should be known when initialize is called and you have to
agree that it should be considered a bug that in this:

#[.snip..]
 @left = stack(:width => 200) { |s|
                        background yellow
                        stack {
                                rect_width = width*0.8
                                @r = rect 0,0, rect_width, 20, :stroke => red, 
:fill => green
                        }
                        para "col 1"

        }
#[..snip..]

`width` is not the width of the surrounding container but of the entire
window (as is parent.width).  No matter if you agree, it would be s
convenient that I plead with you to hand size downwards somehow.

 Shoes.app do
   stack :width => 200 do
     background yellow

     @var = stack do
       3.times { para "TEST STACK" }

       start do
         rect_width = @var.width * 0.8
         @r = @var.rect 0, 0, rect_width, 20,
           :stroke => red, :fill => green
         end
       end
     end

   end
 end

`self` is a confusing thing in Shoes. Read the first two sections of this:
<http://help.shoooes.net/Rules.html>

_why


I did try that but it doesn't work (and I don't just mean the extra end). That does not give me a red and green rectangle anywhere. Maybe you are running on newer code. If so I'm glad you have fixed it. Looking forward to next release :) But I have it figured out for now.


Einar Magnús Boson
+354-661 1649
[EMAIL PROTECTED]
[EMAIL PROTECTED]

Reply via email to