RE: [gtkmm] Modifying a ListStore at runtime?



Also, if you want to add columns to an existing model, instead of just
specifying all the models in the constructor, you need to create a new model
and replace the model in the view. This is also what I do for glom.

Murray Cumming
www.murrayc.com
murrayc usa net

> -----Original Message-----
> From: gtkmm-list-admin gnome org 
> [mailto:gtkmm-list-admin gnome org] On Behalf Of Cumming 
> Murray (CNET External)
> Sent: Donnerstag, 4. Dezember 2003 14:20
> To: roger whinlatter uklinux net; gtkmm-list gnome org
> Subject: RE: [gtkmm] Modifying a ListStore at runtime?
> 
> 
> > All the examples of using a Gtk::ListStore used a derived
> > Gtk::TreeModel::ColumnRecord which adds member variables as 
> > columns using its add() method.
> > 
> > Is it possible to do this as run-time, when you don't know
> > how many columns you need?
> 
> Yes, I do this in glom.
> 
> >  I know I will have an integer
> > column, followed by 1 or many Glib::ustring columns.  I guess 
> > I could do something like:
> > 
> > int integer;
> > Glib::ustring string;
> > Gtk::TreeModel::ColumnRecord list_columns;
> > list_columns.add(integer); for (int i = 0; i < string_cols; ++i)
> >   list_columns.add(string);
> > 
> > If this works, how should I reference the different string
> > columns, since all are using "string".
> 
> By column number. Everything that can take a ModelColumn 
> should have an overload that takes a column number. I think I 
> added some of these to gtkmm 2.4, but I did not need them in 
> glom, which uses gtkmm 2.2.
> 
> Murray Cumming
> www.murrayc.com
> murrayc usa net
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 



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