Re: Treeview scrolling question



thanks for the answer, again!

I think I'm beginning to understand... I was put off by the gtkmm-2.1.0/examples/book/treeview/tree example creating its own Treestore (I prefer this to the ListStore) and then adding rows.

I already have a <list> of data structures, and of course don't want to duplicate it... So I guess I can define a ListStore or TreeStore that models my <list> of data, and then not add rows to this TreeStore, but make it point to my <List>? is this indeed possible?

For example: given

struct dis::My_Node     {
long file_offset; short type; char* label;
};
My_List list<My_Node>

 is this correct?

 class ModelColumns : public Gtk::TreeModel::ColumnRecord
  {
  public:      ModelColumns()
{ add(m_col_offset); add(m_col_type); add(m_col_label)} Gtk::TreeModelColumn<long> m_col_id;
    Gtk::TreeModelColumn<int> m_col_type;
    Gtk::TreeModelColumn<Glib:: Value<char>> m_col_label;
  };    ModelColumns m_Columns;

and then
 m_refTreeModel = My_List?

perhaps? something like this? :-)

and what if in fact the final text I want to show is some kind of elaboration of these fields in My_Node, for example [file_offset] + " : " + [label] ?

bye, Danny.



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