Re: clearing an attribute mapping from treeview columns



On Mon, 2004-10-18 at 10:08, Tim Müller wrote:
On Sunday 17 October 2004 23:57, Markus Lausser wrote:

Background information: In my application i'd to mark lines in a
treeview based on a boolean value in the tree model. The user can modify
the style how the lines should be marked (background, foreground, font,
etc.).

You could use a cell data function and set the cell renderer properties 
yourself for each row dependent on the current setting, instead of using 
attributes.

This actually doesnt solve my problem: i still need to implement a
(generic) data function for the renderers and pass the data column as
argument. 

But i like my implementation: the creator of the treeview should not
have to handle the setup of the line marker. Instead i want a function:
  
  ui_treeview_setup_line_marker(treeview, name_of_style);

This function then observes the style and updates all renderers whenever
the style changes. But as the above function doesnt know anything about
the attribute mappings between the treeview and its model, it doesnt
know which column in the model each renderer represents.
Now i've made a workaround to have access to the data column:
  g_object_set_data(G_OBJECT(rend), "data_col", GINT_TO_POINTER(col));

Markus.





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