[Xfc-dev] A little help

Ricardo M tareasrick at yahoo.com.mx
Wed May 3 01:29:15 CEST 2006


Thank you Benedikt

I've made it, and works!

But what i'm trying to make is a dinamically treeview
to show the content of a different tables, that's why
i wanted to use the tutorial approach.

Thanks!

 --- Benedikt Meurer
<benedikt.meurer at unix-ag.uni-siegen.de> escribió:

> Ricardo M wrote:
> > Have a nice day
> > I've tried to writte a program with the treeview
> > class, but for some reason i don't understand, the
> > program abort in runtime, here's my code:
> > 
> > std::vector<GType> types;
> > for (int i=0; i<nCols; i++) {
> >   types.push_back(G_TYPE_STRING);
> > }
> > 
> > Gtk::ListStore *model = new
> > Gtk::ListStore(nCols,types);
> > ...
> > 
> > But when i compile the result is:
> > 
> > ClassGrid.cc: In constructor
> > `classGrid::classGrid(Xfc::String)':
> > ClassGrid.cc:49: warning: cannot pass objects of
> > non-POD type `class 
> >    std::vector<GType, std::allocator<GType> >'
> through
> > `...'; call will abort 
> >    at runtime
> 
> The constructor is
> 
>  ListStore (int n_columns, const GType *types)
> 
> so you cannot pass an STL vector for the second
> argument, instead use:
> 
> enum
> {
>   COLUMN_1,
>   COLUMN_2,
>   N_COLUMNS,
> };
> 
> //...
> 
> const GType types[N_COLUMNS] = {
>   G_TYPE_STRING,
>   G_TYPE_STRING
> };
> 
> Gtk::ListStore *model = new
> Gtk::ListStore(N_COLUMNS, types);
> 
> where COLUMN_1, COLUMN_2, etc. is just an example.
> The tutorial is a bit
> outdated here unfortunately.
> 
> > Any idea?
> > Thanks in advance
> 
> HTH,
> Benedikt
> _______________________________________________
> Xfc-dev mailing list
> Xfc-dev at xfce.org
> http://foo-projects.org/mailman/listinfo/xfc-dev
> 



	
	
		
___________________________________________________________ 
Do You Yahoo!? 
La mejor conexión a Internet y <b >2GB</b> extra a tu correo por $100 al mes. http://net.yahoo.com.mx 




More information about the Xfc-dev mailing list