Krzysztof B. Wicher wrote:
> I made something similar some time ago. You may want to have a look.
> http://the-shoebox.org/apps/94
> http://the-shoebox.org/apps/101
> 

I did have a look at your Menus.  I had a problem when trying to use
them when attached to my list inside of a slot.  It looked to me like
the problem was related to the positioning code (at least the menu was
always displaying relative to window origin).  Then since I already had
a list, it was almost trivial to implement the DropDownMenu without any
absolute positioning.

The screen shot is probably a little misleading.  The List class is just
a one dimensional list, not an array like a table.  Think of it as
combining HTML's <ul> and <ol> with a little CSS.

Here's an usage example:

    list_options = {:bullet => List::CIRCLE_BULLET,
                    :background => app.cyan}
    list = List.new(app, list_options)
    %w(alpha bravo charlie delta echo foxtrot).each do |item|
      item_options = {:click => lambda{app.alert "#{item} was clicked"}}
      list.add(ListItem.new(item, item_options))
    end
    list.show

Note that item can be anything that works as a parameter to para.

There's more examples in examples/list_widget.rb ;)


Thank you,
Roy

Reply via email to