Class: TkBaseTitledFrame

Inherits:
TkFrame
  • Object
show all
Defined in:
lib/a-tkcommons.rb

Direct Known Subclasses

TkFloatTitledFrame, TkTitledFrame

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent = nil, *args) ⇒ TkBaseTitledFrame

Returns a new instance of TkBaseTitledFrame.



773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
# File 'lib/a-tkcommons.rb', line 773

def initialize(parent=nil, *args)
  super(parent, Arcadia.style('panel'))
  @parent = parent
  @title_height = 18
  @top = TkFrame.new(self){
    background  Arcadia.conf('titlelabel.background')
    #foreground  'white'
    #anchor 'w'
  }.place('x'=>0, 'y'=>0,'height'=>@title_height, 'relwidth'=>1)
  #.pack('fill'=> 'x','ipady'=> @title_height, 'side'=>'top')
  @frame = create_frame
  @button_frame=TkFrame.new(@top){
    #background  '#303b50'
    background  Arcadia.conf('titlelabel.background')
  }.pack('side'=> 'right','anchor'=> 'w')

  @buttons = Hash.new
  @menu_buttons = Hash.new
  @last_for_frame = Hash.new
  self.head_buttons
end

Instance Attribute Details

#frameObject (readonly)

Returns the value of attribute frame.



770
771
772
# File 'lib/a-tkcommons.rb', line 770

def frame
  @frame
end

#topObject (readonly)

Returns the value of attribute top.



771
772
773
# File 'lib/a-tkcommons.rb', line 771

def top
  @top
end

Instance Method Details

#add_fixed_button(_label, _proc = nil, _image = nil, _side = 'right') ⇒ Object



799
800
801
# File 'lib/a-tkcommons.rb', line 799

def add_fixed_button(_label,_proc=nil,_image=nil, _side= 'right')
  __add_button(_label,_proc,_image, _side,@button_frame)
end

#add_fixed_menu_button(_name = 'default', _image = nil, _side = 'right', _args = nil) ⇒ Object



803
804
805
# File 'lib/a-tkcommons.rb', line 803

def add_fixed_menu_button(_name='default',_image=nil, _side= 'right', _args=nil)
  __add_menu_button(_name, _image, _side, _args, @button_frame)
end

#add_fixed_sep(_width = 0) ⇒ Object



807
808
809
# File 'lib/a-tkcommons.rb', line 807

def add_fixed_sep(_width=0)
  __add_sep(_width, @button_frame)
end

#create_frameObject



795
796
797
# File 'lib/a-tkcommons.rb', line 795

def create_frame
  return TkFrame.new(self,Arcadia.style('panel')).place('x'=>0, 'y'=>@title_height,'height'=>-@title_height,'relheight'=>1, 'relwidth'=>1)
end

#head_buttonsObject



875
876
877
# File 'lib/a-tkcommons.rb', line 875

def head_buttons
  @bmaxmin = add_fixed_button('[ ]',proc{resize}, W_MAX_GIF)
end


871
872
873
# File 'lib/a-tkcommons.rb', line 871

def menu_button(_name='default')
  @menu_buttons[_name]
end

#visible?Boolean

Returns:

  • (Boolean)


879
880
881
# File 'lib/a-tkcommons.rb', line 879

def visible?
  TkWinfo.mapped?(self)
end