Class: ArcadiaMainMenu::UserItem
- Inherits:
-
UserItem
- Object
- UserItem
- ArcadiaMainMenu::UserItem
- Defined in:
- lib/a-core.rb
Instance Attribute Summary collapse
-
#menu ⇒ Object
Returns the value of attribute menu.
-
#type ⇒ Object
Returns the value of attribute type.
-
#underline ⇒ Object
Returns the value of attribute underline.
Instance Method Summary collapse
- #enabled=(_value) ⇒ Object
-
#initialize(_sender, _args) ⇒ UserItem
constructor
A new instance of UserItem.
Constructor Details
#initialize(_sender, _args) ⇒ UserItem
Returns a new instance of UserItem.
958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 |
# File 'lib/a-core.rb', line 958 def initialize(_sender, _args) super(_sender, _args) _command = proc{ Arcadia.process_event(@event_class.new(_sender, @event_args)) } if @event_class #_menu = @menu[@parent] item_args = Hash.new item_args['image']=TkPhotoImage.new('data' => @image_data) if @image_data item_args['label']=@caption item_args['underline']=@underline.to_i if @underline != nil item_args['compound']='left' item_args['command']=_command if @type.nil? && _commnad.nil? && @name == '-' @type=:separator item_args.clear elsif @type.nil? @type=:command end @item_obj = @menu.insert('end', @type ,item_args) @index = @menu.index('last') end |
Instance Attribute Details
#menu ⇒ Object
Returns the value of attribute menu.
955 956 957 |
# File 'lib/a-core.rb', line 955 def @menu end |
#type ⇒ Object
Returns the value of attribute type.
957 958 959 |
# File 'lib/a-core.rb', line 957 def type @type end |
#underline ⇒ Object
Returns the value of attribute underline.
956 957 958 |
# File 'lib/a-core.rb', line 956 def underline @underline end |
Instance Method Details
#enabled=(_value) ⇒ Object
980 981 982 983 984 985 986 |
# File 'lib/a-core.rb', line 980 def enabled=(_value) if _value @item_obj.entryconfigure(@index, 'state'=>'enable') else @item_obj.entryconfigure(@index,'state'=>'disable') end end |