Re: [gtkmm] Help for clist



Hi,

* Ottavio Campana <ottavio campana vi it> [2002-12-18 11:46:42]:
> > > I can't insert a row in a clist. I've tried 
> > > 
> > > GMM_CLIST1->rows()->insert(1, "Palla");
> > 
> > rows() doesn't return a pointer. It returns a reference to a RowList -
> > see http://www.gtkmm.org/docs/gtk/Gtk%3A%3ACList.html. Therefor you
> > should correct it to:
> > 
> > GMM_CLIST1->rows().insert(1, "Palla");
> 
> already tried:
> 
> 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
> window1.cc: In method `void window1::on_connetti1_activate()':
> window1.cc:55: no matching function for call to
> `Gtk::CList_Helpers::RowList::insert (int, const char[6])'
> /usr/include/gtk--/clist.h:611: candidates are: class
> Gtk::CList_Helpers::RowIterator
> Gtk::CList_Helpers::RowList::insert(Gtk::CList_Helpers::RowIterator,
> const Gtk::SArray_Helpers::SArray &)
> /usr/include/gtk--/clist.h:612:                 class
> Gtk::CList_Helpers::RowIterator
> Gtk::CList_Helpers::RowList::insert(const Gtk::CList_Helpers::Row &,
> const Gtk::SArray_Helpers::SArray &)
> make: *** [window1.o] Error 1
> bott dirac:~/Progetti/nanuccoli/src/trainer >

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");

  - Morten.




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