Class: ArcadiaMainMenu::UserItem

Inherits:
UserItem
  • Object
show all
Defined in:
lib/a-core.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_sender, _args) ⇒ UserItem

Returns a new instance of UserItem.



679
680
681
682
683
684
685
686
687
688
689
690
691
692
# File 'lib/a-core.rb', line 679

def initialize(_sender, _args)
  super(_sender, _args)
  _image = TkPhotoImage.new('data' => @image_data) if @image_data
  _command = proc{
    Arcadia.process_event(@event_class.new(_sender, @event_args))
  } if @event_class
  #_menu = @menu[@parent]
  @item_obj = @menu.insert('end', :command, 
    'image'=>_image,
    'label'=>@caption, 
    'compound'=>'left',
    'command'=>_command )
  @index = @menu.index('last')
end

Instance Attribute Details

Returns the value of attribute menu.



678
679
680
# File 'lib/a-core.rb', line 678

def menu
  @menu
end

Instance Method Details

#enabled=(_value) ⇒ Object



694
695
696
697
698
699
700
# File 'lib/a-core.rb', line 694

def enabled=(_value)
  if _value
    @item_obj.entryconfigure(@index, 'state'=>'enable')
  else
    @item_obj.entryconfigure(@index,'state'=>'disable')
  end
end