Class: TKXXS_CLASSES::TextW

Inherits:
TkText
  • Object
show all
Includes:
Tk::Tile
Defined in:
lib/tkxxs/tkxxs_classes.rb

Direct Known Subclasses

TKXXS::OutW

Instance Method Summary collapse

Constructor Details

#initialize(parent, hash = {}) ⇒ TextW

Returns a new instance of TextW.



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/tkxxs/tkxxs_classes.rb', line 139

def initialize( parent, hash={} )
  #----  Frame 
  @frame = Frame.new(parent) {padding "3 3 3 3"}.
    pack(:fill=>:both, :expand=>true)

  hash = Marshal.load(Marshal.dump( hash ) ) # Should work because never uses Proc

  hash = {
    :font=>'"Courier New" 10',
    :wrap=>'word',
    :bd=>'2'
  }.merge(hash)
  
  #----  self = TkText
  super(@frame, hash) 
  
  #----  Scrollbars
  sy = Scrollbar.new(@frame)
  sy.pack('side'=>'right', 'fill'=>'y')
  self.yscrollbar(sy)
  
  sx = Scrollbar.new(@frame)
  sx.pack('side'=>'bottom', 'fill'=>'x')
  self.xscrollbar(sx)
  
  self.pack('expand'=>'yes', 'fill'=>'both')
end