Re: Row with different columns at runtime?



Hi,

Thanx for your quick support. Still, I'm sorry I'm confused.
I am not sure, where to call the funky_cell_renderer_some_function. GTKmm 
describes it as if I should create an extra column for the cell:

"pColumn->pack_start(*pRenderer);"

So, in this case, I would need three columns for every renderer of the struct? 
Or just one column for the funky cell renderer (I guess it would be difficult 
to cast, then)?

Kristian Rietveld wrote:
> You can try to use the "visible" property on the cell renderers.  For
> example, you would pack all cell renderers that can possibly appear in
> the column and then set the visible properties from a CellDataFunc
> accordingly.
Where can I do this? In my example, I append a row. I can give the columns in 
this row different values, but where can I set visibility there?

Below, some parts of my code are listed

---------------
My Column Record:
class OptColumns : public TreeModel::ColumnRecord
{
	public:
		OptColumns()
		{
			add(col_value);
					add(col_textedit);
					add(col_checkbox);
		}
	// private:
		TreeModelColumn<string> col_value; // always there
		
		// variable:
		TreeModelColumn<string> col_textedit;
		TreeModelColumn<bool> col_checkbox;
};

---------------
The constructor code:

	Glib::RefPtr<Gtk::ListStore> OptTreeModel; // like Gtk::ListStore*

		// Fill the TreeView's model:
		TreeModel::Row row1 = *(OptTreeModel->append()); // 1st row
		row1[OptCols.col_value] = "links"; // I can set values here, but how to 
modify the widgets?
		row1[OptCols.col_checkbox] = false;
		
		TreeModel::Row row2 = *(OptTreeModel->append());
		row2[OptCols.col_value] = "links";
		row2[OptCols.col_textedit] = "test";

---------------

Thanx for all your help.
Kind Regards,
Johannes


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