Class: ArcadiaMainToolbar
- Inherits:
-
ArcadiaUserControl
- Object
- ArcadiaUserControl
- ArcadiaMainToolbar
- Defined in:
- lib/a-core.rb
Defined Under Namespace
Classes: UserItem
Constant Summary collapse
- SUF =
'user_toolbar'
Instance Method Summary collapse
-
#initialize(_arcadia, _frame) ⇒ ArcadiaMainToolbar
constructor
A new instance of ArcadiaMainToolbar.
- #new_item(_sender, _args = nil) ⇒ Object
- #new_separator ⇒ Object
Methods inherited from ArcadiaUserControl
Constructor Details
#initialize(_arcadia, _frame) ⇒ ArcadiaMainToolbar
Returns a new instance of ArcadiaMainToolbar.
847 848 849 850 851 852 853 854 855 856 |
# File 'lib/a-core.rb', line 847 def initialize(_arcadia, _frame) @arcadia = _arcadia @frame = _frame @frame.borderwidth(Arcadia.conf('panel.borderwidth')) #@frame.highlightbackground(Arcadia.conf('panel.highlightbackground')) @frame.relief(Arcadia.conf('panel.relief')) @context_frames = Hash.new @last_context = nil end |
Instance Method Details
#new_item(_sender, _args = nil) ⇒ Object
858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 |
# File 'lib/a-core.rb', line 858 def new_item(_sender, _args= nil) _context = _args['context'] # if _context # if @context_frames[_context] # else # @context_frames[_context] = TkLabelFrame.new(@frame){ # text "" # relief 'groove' # pack('side' =>'left', :padx=>0, :pady=>0) # } # end # _args['frame']=@context_frames[_context] # else # _args['frame']=@frame # end if @last_context && _context != @last_context new_separator end @last_context = _context _args['frame']=@frame super(_sender, _args) end |
#new_separator ⇒ Object
881 882 883 884 885 886 |
# File 'lib/a-core.rb', line 881 def new_separator Tk::BWidget::Separator.new(@frame, :orient=>'vertical', :background=>Arcadia.conf('button.highlightbackground') ).pack('side' =>'left', :padx=>2, :pady=>2, :fill=>'y',:anchor=> 'w') end |