Class: MyCellRendererToggle
- Inherits:
-
Gtk::CellRendererToggle
- Object
- Gtk::CellRendererToggle
- MyCellRendererToggle
- Defined in:
- lib/ListHolder/EditableList/CellRenderers/Toggle.rb
Overview
this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint([email protected])
Instance Method Summary collapse
-
#data ⇒ Object
we don’t wrap this :).
-
#initialize(column) ⇒ MyCellRendererToggle
constructor
A new instance of MyCellRendererToggle.
- #set_column(column) ⇒ Object
- #set_font(font) ⇒ Object
- #set_wrap_width(width) ⇒ Object
- #text ⇒ Object
Constructor Details
#initialize(column) ⇒ MyCellRendererToggle
Returns a new instance of MyCellRendererToggle.
6 7 8 9 10 11 12 13 14 |
# File 'lib/ListHolder/EditableList/CellRenderers/Toggle.rb', line 6 def initialize(column) super() signal_connect("editing-started"){|cell, editable, path| false } signal_connect("toggled"){|me,path| @column.list.list_model.change_value_of_path(path,@column.header['data'],!active?) } end |
Instance Method Details
#data ⇒ Object
we don’t wrap this :)
27 28 29 |
# File 'lib/ListHolder/EditableList/CellRenderers/Toggle.rb', line 27 def data header["data"] end |
#set_column(column) ⇒ Object
16 17 18 19 |
# File 'lib/ListHolder/EditableList/CellRenderers/Toggle.rb', line 16 def set_column(column) @column=column set_activatable(@column.header['editable']) end |
#set_font(font) ⇒ Object
31 32 33 |
# File 'lib/ListHolder/EditableList/CellRenderers/Toggle.rb', line 31 def set_font(font) #doing nothing here end |
#set_wrap_width(width) ⇒ Object
24 25 26 |
# File 'lib/ListHolder/EditableList/CellRenderers/Toggle.rb', line 24 def set_wrap_width(width) #we don't wrap this :) end |
#text ⇒ Object
21 22 23 |
# File 'lib/ListHolder/EditableList/CellRenderers/Toggle.rb', line 21 def text active end |