Class: ArcadiaMainToolbar::UserItem
- Inherits:
-
UserItem
- Object
- UserItem
- ArcadiaMainToolbar::UserItem
- Defined in:
- lib/a-core.rb
Instance Attribute Summary collapse
-
#frame ⇒ Object
Returns the value of attribute frame.
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.
809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 |
# File 'lib/a-core.rb', line 809 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 @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 if 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
#frame ⇒ Object
Returns the value of attribute frame.
808 809 810 |
# File 'lib/a-core.rb', line 808 def frame @frame end |
Instance Method Details
#enabled=(_value) ⇒ Object
837 838 839 840 841 842 843 |
# File 'lib/a-core.rb', line 837 def enabled=(_value) if _value @item_obj.state='enable' else @item_obj.state='disable' end end |