[Glade-users] Getting the model column for cell renderer attribute

For the current project that I'm working on, which unfortunately needs
to target Gtk+ 2.12, I have designed several GtkBuilder UIs using the
Win32 build of Glade 3.6.7. For most of the tree views in the project,
I would like the tree view columns to be able to set their sort column
ID dynamically, based on which column of the model the cell renderer
gets the "text" attribute from (if any), rather than having to
remember to add a new gtk_tree_view_column_set_sort_column_id() line
every time I add a new column to a tree view.

However, there is no complement "get" function for
gtk_cell_layout_set_attributes(), so I'm struggling to work out if it
can be done without parsing the XML. I can't set it in Glade because
the sort_column_id property isn't supported until Gtk+ 2.18.

I've attached a highly simplified version of my UI and code to
illustrate what I mean, the two lines that I've commented out are
where I'm stuck. In this simplified example I could just use a loop
counter variable, but obviously it's not quite so simple in the actual
project code.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.glade
Type: application/x-glade
Size: 3678 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/glade-users/attachments/20111215/25525751/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 1133 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/glade-users/attachments/20111215/25525751/attachment-0001.bin 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]