class Canis::ActionManager
Attributes
actions[R]
Public Class Methods
new()
click to toggle source
# File lib/canis/core/include/actionmanager.rb, line 17 def initialize #form, config={}, &block @actions = [] #instance_eval &block if block_given? end
Public Instance Methods
add_action(act)
click to toggle source
# File lib/canis/core/include/actionmanager.rb, line 21 def add_action act @actions << act end
insert_action(pos, *val)
click to toggle source
insert an item at given position (index)
# File lib/canis/core/include/actionmanager.rb, line 29 def insert_action pos, *val @actions[pos] = val end
remove_action(act)
click to toggle source
# File lib/canis/core/include/actionmanager.rb, line 24 def remove_action act @actions.remove act end
show_actions()
click to toggle source
popup the hist
# File lib/canis/core/include/actionmanager.rb, line 38 def show_actions return if @actions.empty? list = @actions menu = PromptMenu.new self do |m| list.each { |e| m.add *e } end menu.display_new :title => 'Widget Menu (Press letter)' end