Class: ActiveWindow::ActiveFloatColumn
Overview
TODO: configure the number of digits printed
Constant Summary
Constants inherited
from ActiveColumn
ActiveWindow::ActiveColumn::ClassesToSymbols
Instance Attribute Summary
Attributes inherited from ActiveColumn
#id, #name
Instance Method Summary
collapse
create, #hide!, #initialize, #virtual?, #visible?
Instance Method Details
#attribute ⇒ Object
149
150
151
|
# File 'lib/active_window/active_column.rb', line 149
def attribute
:text
end
|
#data_class ⇒ Object
143
144
145
|
# File 'lib/active_window/active_column.rb', line 143
def data_class
Float
end
|
#data_value(ar_object) ⇒ Object
157
158
159
|
# File 'lib/active_window/active_column.rb', line 157
def data_value(ar_object)
super(ar_object) || 0
end
|
#renderer ⇒ Object
146
147
148
|
# File 'lib/active_window/active_column.rb', line 146
def renderer
Gtk::CellRendererText.new
end
|
#view ⇒ Object
152
153
154
155
156
|
# File 'lib/active_window/active_column.rb', line 152
def view
super.set_cell_data_func(renderer) do |col, renderer, model, iter|
renderer.text = sprintf("%.2f", iter[self.id])
end
end
|