Creating Editable Cell Columns in the Gtk Tree Tree Using Glade

I am trying to create a simple graphical interface with a table containing the x and y coordinates of the samples. I use treeview and I want the table cells to be editable by the user. Is it possible to indicate whether cells should be edited directly in the Glade properties in the cellrenderer properties, or should I specify it in my code? I am using Glade 3.6.1

I just found that in the view tree editor when editing my tree image the Editable box allows you to specify whether the cells will be editable or not, because if the box is not peeled, the property the cells are editing is longer associated with the model . But if I run the program, the cells are edited, but the value that I write inside disappears. How can i fix this? Why does the cell not save the value that I entered inside?

Thanks for any hint.

+5
source share
2 answers

For those who are dealing with a similar problem, I solved it - whenever a cell is edited, you need to change the corresponding entry in the model, for example, code in Python:

cell.connect("edited", self.text_edited, model, column)

def text_edited( self, w, row, new_text, model, column)
  model[row][column] = new_text
+3

, - , Ubuntu Quickly. "" "" , "/". :

#psuedo-code function definition
cellcolumn_widget.connect("edited", self.function, list_or_treestore, columnnumber)

#actual code, editing second column so column is passed as 1
self.builder.get_object("cellrenderer_chapter").connect("edited", self.cell_edited, self.builder.get_object("liststore_chapters"),1)

def cell_edited(self, widget, row, new_text, model, column):
    model.set_value(model.get_iter(row),column,new_text)
0

All Articles