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


But then I tried running it again and it does work. Almost at least, It paints on resize but not before. but then it does it correctly!

I'm on OS X 10.5.5


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

Reply via email to