Skip to content

Commit

Permalink
widgetmenu.rb using self extended to set up
Browse files Browse the repository at this point in the history
  • Loading branch information
rkumar committed Jan 3, 2012
1 parent ac01683 commit 67072b5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/rbcurse/core/include/widgetmenu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,21 @@ module WidgetMenu
# key, symbol
# Action
# Action[] (maybe)
def self.extended(obj)
obj.instance_exec {
@_menuitems ||= []
obj.init_menu if obj.respond_to? :init_menu
}

end
def add_menu_item *val
@_menuitems ||= []
#@_menuitems ||= []
@_menuitems << val
end
#
# insert an item at given position (index)
def insert_menu_item pos, *val
@_menuitems ||= []
#@_menuitems ||= []
@_menuitems[pos] = val
end
def create_menuitem *args
Expand Down

0 comments on commit 67072b5

Please sign in to comment.