Displaying 1 result from an estimated 1 matches for "add_menu_item".
2004 Aug 25
7
problem subclassing Wx::Menu
...asyMenu.next_base()
@commands = {}
end
# adds a menu item with the title +command_str+, optionally bound to
# the shortcut key +command_key+, and binds the menu item to the
# block argument. Returns a symbol which can be later used to
# identify the menu item to other arguments
def add_menu_item(command_str, command_key = '''')
const = ( @base_id += 1 )
ident = command_str.gsub(/\s+/, "_").gsub(/\W/, "").downcase.to_sym
@commands[ident] = const
# WHY DOES THIS SEGFAULT?!
append(const, "#{command_str}\t#{command_key}")
#...