Re: [gtkmm] Help for clist



Hi,

* Ottavio Campana <ottavio campana vi it> [2002-12-18 12:32:10]:
> On Wed, Dec 18, 2002 at 12:14:29PM +0100, Morten Brix Pedersen wrote:
> > As you can see from the error, you are trying to call a function with an
> > int as the first argument, while that actually should be a Row or a
> > RowIterator.
> > 
> > A quick glance at the documentation tells me that you can get a Row by
> > doing: GMM_CLIST1->row(rownumber), thus your code should be:
> > 
> > GMM_CLIST1->rows().insert(GMM_CLIST1->row(1), "Palla");
> 
> I've already tried even it:
> 
> c++ -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../.. -I../low -I../medium -g -O2
> -I/usr/lib/gtkmm/include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 
> -I/usr/lib/glib/include -I/usr/X11R6/include -I/usr/lib/sigc++-1.0/include 
> -I/usr/include/sigc++-1.0 -DDEBUG -c window1.cc
> /usr/include/gtk--/base.h: In function `static const char *const *Gtk::SArray_Helpers::Traits<char
> *>::get_data(const char *)':
> /usr/include/gtk--/base.h:704:   instantiated from `Gtk::SArray_Helpers::SArray::SArray<char[6]>(const char (&)[6])'
> window1.cc:55:   instantiated from here 
> /usr/include/gtk--/base.h:655: const_cast from `const char *' to `const char *const *'
> make: *** [window1.o] Error 1
> bott dirac:~/Progetti/nanuccoli/src/trainer >

Well, we're getting close, aren't we?

I don't know whether it's the correct solution, but I see from my old
gtkmm 1.2 code that I usually inserted my values into a vector and
passed that to the second argument of insert().

The thing is that you are inserting a row - so it expects an array of
strings, not just a single string. Each element in the array/vector will
represent a column E.g.

vector<string> foo;
foo.push_back("Hello"); // Will be in column 1
foo.push_back("World"); // Will be in column 2

GMM_CLIST1->rows().insert(GMM_CLIST1->row(1), foo);

It's a bit awkward to do that when you only have one column, but that's
gtkmm 1.2 for you. :-)

  - Morten.




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