Gtk::TreeRow set_value segmentation fault
- From: Benjamin Waldher <b waldher comcast net>
- To: gtkmm-list gnome org
- Subject: Gtk::TreeRow set_value segmentation fault
- Date: Tue, 02 Dec 2008 11:41:28 -0800
I can't seem to set the value of a cell after creating a table. Here is
a sample of the code that causes problems:
SetWindow::SetWindow(BaseObjectType *cobject, const
Glib::RefPtr<Gnome::Glade::Xml>& refGlade){
refGlade->get_widget("bondCoeffsView", bondCoeffsView);
bondCoeffsModel = Gtk::ListStore::create(bondCoeffsColumns);
bondCoeffsView->set_model(bondCoeffsModel);
Gtk::TreeRow br = *(bondCoeffsModel->append());
bondCoeffsView->append_column("#", bondCoeffsColumns.num);
bondCoeffsView->append_column_editable("Coeff 1",
bondCoeffsColumns.coeffs[0]);
bondCoeffsView->append_column_editable("Var",
bondCoeffsColumns.isVars[0]);
bondCoeffsView->append_column_editable("Coeff 2",
bondCoeffsColumns.coeffs[1]);
bondCoeffsView->append_column_editable("Var",
bondCoeffsColumns.isVars[1]);
bondCoeffsModel->signal_row_changed().connect(sigc::mem_fun(*this,
&SetWindow::on_bondCoeffsModel_changed));
}
void SetWindow::on_bondCoeffsModel_changed(const Gtk::TreeModel::Path&
path, const Gtk::TreeModel::iterator& iter){
int n = 1;
for(Gtk::TreeModel::Children::iterator chIt =
bondCoeffsModel->children().begin(); chIt !=
bondCoeffsModel->children().end(); chIt++){
chIt->set_value(bondCoeffsColumns.num, n);
n++;
}
}
The cause seems to be the 'chIt->set_value(columns.num, n);' line. All I
get is 'Segmentation Fault.' Valgrind outputs this:
Process terminating with default action of signal 11 (SIGSEGV)
Access not within mapped region at address 0xBE4BBFEC
at 0x48EB82c: g_type_check_value (in /usr/lib/libgobject-2.0.so.0.1400.3)
Stack overflow in thread 1: can't grow stack to 0xBE4BBFE8
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]