Re: TreeView Design



On Thu, 31 Aug 2006 09:10:04 -0500, Gareth Foster <earthwormgaz googlemail com> wrote:

have you not read any of the examples? of course its possible.


To make this clearer, I seem to hit the following trouble in trying to
ape the GTKmm API.

The problem really is how can I have a container that stores various
instances of a templated class, and be able to meaningfully interact
with the classes in that container. For example, assign them.

<code>
struct Base;

template <typename T>
struct Derived { T member; };

Did you mean:

struct Derived: public Base { ... };

? Otherwise can not understand the role of Derived template in a given example.


std::list<Base *> myList;

for(std::list<Base *>::iterator it = myList.begin(); it != myList.end(); ++ it)
{
  it->member = ???

it->member = <any pointer to a class/struct that derived from Base>;

}

I can see that the TreeModelColumnBase class, and a templated
derivation of it allow me to keep a list of columns that contain an
arbitary data type, but I can't then see how I can later assign that
data, in this case when iterating the tree model.
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



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