RE: [gtkmm] TreeView Model, SEGV on append
- From: "Ohrnberger, Erik" <erik_ohrnberger dme net>
- To: 'Jeff Gavin' <jeff ezclick net>
- Cc: "'gtkmm-list gnome org'" <gtkmm-list gnome org>
- Subject: RE: [gtkmm] TreeView Model, SEGV on append
- Date: Wed, 29 Oct 2003 12:11:56 -0500
Digging a little more into this confirms that pMoldListModel is NULL
in the method that is trying to use it to append a new line.
However, pMoldListModel is initialized in the CTOR of the containing
class, which makes me think that it's somehow loosing it's state between the
CTOR and the method that wants to use it to add new items to the list.
In addition, I've made sure that on this containing class' CTOR,
ScrolledWindow(), // containing class is subclass of
tvMTBList(), // TreeView widget
pMTBListModel() // Model.
and in the CTOR, there is code that news the columns
pCols = new MoldListCols();
creates the model:
pMoldListModel = ListStore::create( *pCols );
also appends columns to the treeview, adds the treeview widget to
the containing class (ScrolledWindow) and show it.
The workaround that I have in place now is to re-create the model
each time that I want to add a new item to the list completely populating
the list from scratch.
However, this is less than satisfying.
Are there any known problems with not using dynamic objects for the
ScrolledWindow, the TreeView, or the TreeView model? I've decld them as
automatic inside of the class as data members.
> -----Original Message-----
> From: Jeff Gavin [mailto:jeff ezclick net]
> Sent: Friday, October 24, 2003 5:15 PM
> To: Ohrnberger, Erik
> Cc: 'gtkmm-list gnome org'
> Subject: Re: [gtkmm] TreeView Model, SEGV on append
> Ohrnberger, Erik wrote:
> > I'm hoping that someone can give me a pointer on tracking
> the issue down
> > with my code.
> > I build a scrolled windows, attach a treeview to it, create the
> > ListStore::create to create the model, and set this model
> to the treeview.
> > Next, I append my columns to the treeview and try and
> perform an append on
> > the model. It's right on the statement below:
> > TreeModel::Row row = *( pMoldListModel->append() );
> To help isolate this type of error, split the line:
> TreeModel::Row row;
> row = *( pMoldListModel->append() );
> to help determine where the problem if the problem is in the
> construction of 'row' or the call to append.
> Without seeing the rest of the code, my bet is on pMoldListModel not
> being initialized.
> > Where the program gets a segv and crashes the program inside of the
> > gtkmm-2.2.5. As it's crashing right inside this call into
> the libraries,
> > what do you think is went wrong? What should I do to track
> this further
> > down?
> > Thanks,
> > Erik.
> > Erik_Ohrnberger<-at->DME.net
> > _______________________________________________
> > gtkmm-list mailing list
> > gtkmm-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtkmm-list
] [Thread Prev