Re: [gtkmm] Error with Glib:RefPtr<Gtk::TreeModel::Row>



>>Glib::RefPtr<> is for use with types that derive from Glib::Object.
>>
>>You do not need to put a TreeModel::iterator or TreeModel::Row in a
>> RefPtr.
>
> but treestore is direved from Glib:::Objects,

Yes, but what does that have to do with anything? There is no error when
you use Glib::RefPtr<Gtk::TreeStore>

> So if I wane heve a
> pointer to a row I have to use Gtk::TreeMode::Row* row.

Why do you want to have a pointer to a row?

> But what if I want to referance a iterator of it I can't use
> Gtk::TreeModel::iterator it = *row correct.

You get rows by dereferencing iterators, like so:
Gtk::TreeModel::Row row = *iter;

Likewise, in a std::list<int>, you would not do.

int* pValue = 1;
std::list<int>::iterator it = *pValue;

You don't get iterators by dereferencing rows, or "pointers to rows". You
get iterators from the TreeModel.

> I have to use
> row->operator*() or is there a easier way?
> Grtz Bart

There are plenty of gtkmm TreeView examples - you can see the source in
the gtkmm book online.

Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com



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