Class: TkWrapper::Util::Tk::Cell

Inherits:
Object
  • Object
show all
Defined in:
lib/util/tk/cell.rb

Instance Method Summary collapse

Constructor Details

#initialize(widget) ⇒ Cell

Returns a new instance of Cell.



6
7
8
# File 'lib/util/tk/cell.rb', line 6

def initialize(widget)
  @widget = widget
end

Instance Method Details

#bboxObject

returns the bounding box of the tk_widget



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/util/tk/cell.rb', line 11

def bbox
  return unless (container = container_parent)

  grid_info = TkGrid.info(@widget.tk_widget)
  start_col = grid_info['column']
  end_col = start_col + grid_info['columnspan'] - 1
  start_row = grid_info['row']
  end_row = start_row + grid_info['rowspan'] - 1

  container.tk_widget.update
  TkGrid.bbox(container.tk_widget, start_col, start_row, end_col, end_row)
end