Class: TkFrameAdapter
- Inherits:
-
TkFrame
- Object
- TkFrame
- TkFrameAdapter
show all
- Includes:
- TkMovable
- Defined in:
- lib/a-tkcommons.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from TkMovable
#moving_do_move_obj, #moving_do_press, #start_moving, #stop_moving
Constructor Details
#initialize(scope_parent = nil, *args) ⇒ TkFrameAdapter
239
240
241
242
243
|
# File 'lib/a-tkcommons.rb', line 239
def initialize(scope_parent=nil, *args)
super(scope_parent, *args)
@scope_parent = scope_parent
@movable = true
end
|
Instance Attribute Details
#frame ⇒ Object
Returns the value of attribute frame.
238
239
240
|
# File 'lib/a-tkcommons.rb', line 238
def frame
@frame
end
|
Instance Method Details
#add_moved_by(_obj) ⇒ Object
245
246
247
248
|
# File 'lib/a-tkcommons.rb', line 245
def add_moved_by(_obj)
@movable = true
start_moving(_obj, self)
end
|
#attach_frame(_frame) ⇒ Object
262
263
264
265
266
267
268
269
270
271
|
# File 'lib/a-tkcommons.rb', line 262
def attach_frame(_frame)
@frame = _frame
refresh
if @movable
@frame.bind_append("Configure",proc{ refresh})
@frame.bind_append("Map",proc{refresh})
@frame.bind_append("Unmap",proc{unplace})
end
self
end
|
#detach_frame ⇒ Object
250
251
252
253
254
255
256
257
258
259
260
|
# File 'lib/a-tkcommons.rb', line 250
def detach_frame
if @frame
if @movable
@frame.bind_remove("Configure")
@frame.bind_remove("Map")
@frame.bind_remove("Unmap")
end
@frame = nil
self.unplace
end
end
|
#refresh(_x = 0, _y = 0) ⇒ Object
274
275
276
|
# File 'lib/a-tkcommons.rb', line 274
def refresh(_x=0, _y=0)
place('in'=>@frame, 'x'=>_x, 'y'=>_y, 'relheight'=> 1, 'relwidth'=>1, 'bordermode'=>'outside')
end
|