[Xfc-dev] A little help

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Thu May 4 17:33:20 CEST 2006


Ricardo M wrote:
> Thank you!
> Here's my ListSt.hh code, the header of my new
> ListStore class:
> 
> #include <xfc/gtk/liststore.hh>
> 
> using namespace Xfc;
> 
> class listStor : public Gtk::ListStore
> {
>   int nColumnas;
> 
> public:
>   listStor (int nCols);
>   virtual ~listStor();
> };
> 
> 
> 
> And the body of the class in file ListStore.cc:
> 
> #include <xfc/gtk/liststore.hh>
> #include "ListSt.hh"
> 
> listStor::listStor (int nCol)
> {
>   nColumnas = nCol;
>   GType types[nCol];
> 
>   for (int n=0; n<nCol; ++n)
>     types[n] = G_TYPE_STRING;
>   set_column_types (nCol, types);
> }

Uhm, looks correct. Try allocating the types on the heap instead:

GType *types = new GType[nCol];
for (int n = 0; n < nCol; ++n)
  types[n] = G_TYPE_STRING;
set_column_types (nCol, types);
delete[] types;

If that doesn't work, send a backtrace of the crash.

> Thank you

Benedikt



More information about the Xfc-dev mailing list