[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?  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".

What is the best way to achieve this?


Many thanks,
Roger

-- 
Roger Leigh

                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.



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