Class: ArcadiaMainToolbar::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.



532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
# File 'lib/a-core.rb', line 532

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
  _hint = @hint
  _font = @font
  _caption = @caption
  @item_obj = Tk::BWidget::Button.new(_args['frame'], Arcadia.style('toolbarbutton')){
    image  _image if _image
    #borderwidth 1
    #font _font if _font
    #activebackground Arcadia.conf('button.activebackground')
    #activeforeground Arcadia.conf('button.activeforeground')
    #background Arcadia.conf('button.background')
    #foreground Arcadia.conf('button.foreground')
    #highlightbackground Arcadia.conf('button.highlightbackground')
    #relief Arcadia.conf('button.relief')
    command _command if _command
    #relief 'groove'
    width 20
    height 20
    helptext  _hint if _hint
    text _caption if _caption
    pack('side' =>'left', :padx=>2, :pady=>0)
  }
  #Tk::BWidget::Separator.new(@frame, :orient=>'vertical').pack('side' =>'left', :padx=>2, :pady=>2, :fill=>'y',:anchor=> 'w')
end

Instance Attribute Details

#frameObject

Returns the value of attribute frame.



531
532
533
# File 'lib/a-core.rb', line 531

def frame
  @frame
end

Instance Method Details

#enabled=(_value) ⇒ Object



560
561
562
563
564
565
566
# File 'lib/a-core.rb', line 560

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