Re: [gtkmm] TreeView Model, SEGV on append



Am 2003.10.29 18:11 schrieb(en) "Ohrnberger, Erik":
Jeff,
	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.

This seems all wrong! I'm creating lists in exactly the same way.
You can see the entries you add in the ctor, can't you?

Have you tried to keep an additional reference on the newly
created ListStore e.g. in global scope like I suggested earlier?

	In addition, I've made sure that on this containing class'
CTOR,
that.....

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

You needn't allocate the columns dynamically, by the way.

	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?

Sorry, what would this mean:
I've decld them
as
automatic inside of the class as data members.

Regards,

  Martin



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