DictionaryGrid cell-edited event should include the old row value in addition to the edited value
Bug #568761 reported by
Rick Spencer
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Quickly Widgets |
Confirmed
|
Undecided
|
Rick Spencer |
Bug Description
after a change occurs, I would like to test if I need to delete the old values. However, the old value is not included so I have to write copious code to connect to the cell-edited event for the underlying cell rendered.
To post a comment you must log in.
Here's some sample code to work around this until it is fixed. This just uses the gtk.TreeView functionality, so it should continue working even after the bug is fixed
#first, create a grid as normal
self.views_ grid = DictionaryGrid( {},keys= ["Design Document" ,"View" ],editable= True)
self.views_ grid.connect( "selection- changed" , self.view_selected)
self.views_ grid.show( )
#then loop through the columns in the grid and hook up signal handler grid.get_ columns( ):
c.renderer. connect( "edited" ,self.design_ doc_edited, c)
c.renderer. connect( "edited" ,self.view_ name_edited, c)
#for the columns that you want track editing for
for c in self.views_
if c.key == "Design Document":
elif c.key == "View":
#Then in the signal handlers, you get the info that you need doc_edited( self, cell, path, new_dd, col): grid.get_ model() .get_iter( path) grid.get_ model() .get_value( iter,0) grid.get_ model() .get_value( iter,1)
#the new value is passed in, but the old value is still available
#Note that the DictionaryGrid will change the value for you
def design_
iter = self.views_
old_dd = self.views_
view_name = self.views_