Class: TkBaseTitledFrame
- Inherits:
-
TkFrame
- Object
- TkFrame
- TkBaseTitledFrame
show all
- Defined in:
- lib/a-tkcommons.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(parent = nil, *args) ⇒ TkBaseTitledFrame
Returns a new instance of TkBaseTitledFrame.
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
|
# File 'lib/a-tkcommons.rb', line 749
def initialize(parent=nil, *args)
super(parent, Arcadia.style('panel'))
@parent = parent
@title_height = 18
@top = TkFrame.new(self){
background Arcadia.conf('titlelabel.background')
}.place('x'=>0, 'y'=>0,'height'=>@title_height, 'relwidth'=>1)
@frame = create_frame
@button_frame=TkFrame.new(@top){
background Arcadia.conf('titlelabel.background')
}.pack('side'=> 'right','anchor'=> 'w')
@buttons = Hash.new
@menu_buttons = Hash.new
self.head_buttons
end
|
Instance Attribute Details
#frame ⇒ Object
Returns the value of attribute frame.
746
747
748
|
# File 'lib/a-tkcommons.rb', line 746
def frame
@frame
end
|
#top ⇒ Object
Returns the value of attribute top.
747
748
749
|
# File 'lib/a-tkcommons.rb', line 747
def top
@top
end
|
Instance Method Details
773
774
775
776
777
778
779
780
781
782
783
784
785
|
# File 'lib/a-tkcommons.rb', line 773
def add_button(_label,_proc=nil,_image=nil, _side= 'right')
TkButton.new(@button_frame, Arcadia.style('toolbarbutton')){
text _label if _label
image TkPhotoImage.new('dat' => _image) if _image
font 'helvetica 8 bold'
pack('side'=> _side,'anchor'=> 'e')
bind('1',_proc) if _proc
}
end
|
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
|
# File 'lib/a-tkcommons.rb', line 787
def (_name='default',_image=nil, _side= 'right')
@menu_buttons[_name] = TkMenuButton.new(@button_frame, Arcadia.style('titlelabel')){|mb|
indicatoron true
TkMenu.new(mb, Arcadia.style('titlemenu'))
if _image
image TkPhotoImage.new('dat' => _image)
end
pack('side'=> _side,'anchor'=> 'e')
}
@menu_buttons[_name]
end
|
#create_frame ⇒ Object
769
770
771
|
# File 'lib/a-tkcommons.rb', line 769
def create_frame
return TkFrame.new(self,Arcadia.style('panel')).place('x'=>0, 'y'=>@title_height,'height'=>-@title_height,'relheight'=>1, 'relwidth'=>1)
end
|
809
810
811
|
# File 'lib/a-tkcommons.rb', line 809
def head_buttons
@bmaxmin = add_button('[ ]',proc{resize}, W_MAX_GIF)
end
|
805
806
807
|
# File 'lib/a-tkcommons.rb', line 805
def (_name='default')
@menu_buttons[_name]
end
|