in python you can do
def cell_data_func(self, tree_column, cell, tree_model, iter, data):
if tree_column is self.col_a:
# code
else if tree_column is self.col_b:
# code
see How do I check if two variables reference the same object in Python?
On 2018-05-08 14:20 Luca Bacci wrote:
>- Use Cell Data Func for ultimate flexibility
That is the signature
Gtk.TreeCellDataFunc(tree_column, cell, tree_model, iter, data)
But how do I know which cell (row and column) is affected?
I can extrat the row with
To have empty int cells, you can either
- use strings, instead of ints, in ListStore as you said
- make place for a third value in ListStore, of type bool, and control
the "visible" property of the first Cell Renderer with it (see code below)
- Use Cell Data Func for ultimate
Hello!
You can achieve what you want with the "xalign" property of CellRenderers
col_b = Gtk.TreeViewColumn('str',
Gtk.CellRendererText(xalign=1),
text=1)
xalign takes a value between 0 and 1.
xalign=0 -> left-justified
xalign=1 ->
X-Post: https://stackoverflow.com/q/50194505/4865723
I want to have in a Gtk.TreeView
- empty cells in a "int row" of a TreeView
- or (as a workaround) a right aligned "string row"
There is a screenshot and example code in the StackOverflow question
linked in the first line of this