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.
1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 |
# File 'lib/a-core.rb', line 1214 def initialize(_sender, _args) super(_sender, _args) _command = @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.
1211 1212 1213 |
# File 'lib/a-core.rb', line 1211 def @menu end |
#type ⇒ Object
Returns the value of attribute type.
1213 1214 1215 |
# File 'lib/a-core.rb', line 1213 def type @type end |
#underline ⇒ Object
Returns the value of attribute underline.
1212 1213 1214 |
# File 'lib/a-core.rb', line 1212 def underline @underline end |
Instance Method Details
#enabled=(_value) ⇒ Object
1234 1235 1236 1237 1238 1239 1240 |
# File 'lib/a-core.rb', line 1234 def enabled=(_value) if _value @item_obj.entryconfigure(@index, 'state'=>'enable') else @item_obj.entryconfigure(@index,'state'=>'disable') end end |