Re: Getting the TreeModelColumns from a Glade file

On Sat, 2010-06-12 at 06:40 +0200, Dominik Gabi wrote: 
> Hi,
> I'd like to set and get the values of a Gtk::TreeStore that I've 
> instantiated in Glade. I'd like to do this the way it is done in the 
> gtkmm-tutorial (with the overloaded [] operator of the TreeRow). 

If you can get the model using Gtk::Builder::get_object(), it should be
possible to get to a desired row by dereferencing an iterator of the
model (see Gtk::TreeModel::get_iter()[1] and the section on "Iterating
over Model Rows"[2] in the online book).  You would have to define a
Gtk::TreeModelColumnRecord corresponding to the model so that something

(*iter)[columns.a_column] = ...;

could be done.


> The 
> problem is that, I either generate the whole TreeView in the code (which 
> I'd like to avoid, if somehow possible) and specify the necessary 
> TreeModelColumns by hand, or I have to extract them somehow from what is 
> generated in Glade. Since the columns are not objects in Glade, I was 
> hoping I could access them using the model or the view... Unfortunately 
> I can't find anything in the documentation.

It should be possible to get the columns of the TreeView (created in
glade) using Gtk::TreeView::get_column().

> Is there an easier way to manipulate a TreeRow or am I just missing 
> something here?


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