[gtkmm] RE: TreeView Model, SEGV on append - more info



Everyone,
	I have a little bit more information on this.

	In the class that uses the TreeView, I have the following
organization:

Class is subclassed from Gtk::ScrolledWindow, and contains the following
data members:
	Gtk::TreeView					tvMoldList;
	MoldListCols*					pCols;
	Glib::RefPtr<Gtk::ListStore>			pMoldListModel;

In the class CTOR, I create the column instance (pCols) with a new.  I also
create the model:
	pMoldListModel = ListStore::create( *pCols );

Set the model to the treeview:
	tvMoldList.set_model( pMoldListModel );

and then append the columns to the treeview:
	tvMoldList.append_column( "Icon", (*pCols).Icon );

In the MoldListCols CTOR, I add it's columns:
	add( Icon ); ....

In one of the class's methods, I want to add a single line to the model,
however, by then the data member pMoldListModel returns a NULL, like it's
lost scope or something.  Well, once I create another model, load all the
items that should be in there and append line item that I wanted originally,
it appears to work just fine.

It strikes me as strange that the model data member (pMoldListModel) would
loose it's value between method calls.  You would think that it would
maintain it's value so that you could manipulate the model for the lifetime
of the object.

What do you think?  Is this in fact the expected behavior of the TreeView,
Gtk::ListStore classes?

Erik.

-----Original Message-----
From: Ohrnberger, Erik 
Sent: Friday, October 24, 2003 3:27 PM
To: 'gtkmm-list gnome org'
Subject: TreeView Model, SEGV on append


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

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




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