So, about widgets.. some example code from a recent thread:

On Thu, Sep 25, 2008 at 1:59 PM, Joshua Choi <[EMAIL PROTECTED]> wrote:
>  class TestingWidget1 < Widget
>
>    def initialize &optional_block
>      if block_given?
>        para 'This block was given to me: ', optional_block.inspect
>      else
>        para 'A block was not given to me. In other words,
> optional_block == nil'
>      end
>    end
>
>  end
>
>  class TestingWidget2 < Widget
>
>    def initialize &optional_block
>      if block_given?
>        para 'I got a block, even though I should not have one!'
>      else
>        para 'I did not get a block, which is what should happen.'
>      end
>    end
>
>  end
>
>        Shoes.app do
>
>    testingwidget1 do
>      para 'I am inside a block.'
>    end
>
>    testingwidget1
>
>    testingwidget2
>
>  end

I think it would be nicer if the generated method names had
underscores to mark the separation of words. e.g. SuperMegaWidget
becomes super_mega_widget.

-- 
Seth Thomas Rasmussen
http://greatseth.com

Reply via email to