Re: Dynamic poplulating of TreeView/ListStore
- From: Murray Cumming <murrayc murrayc com>
- To: gig-raf <dbrandt db-cc de>
- Cc: gtkmm-list gnome org
- Subject: Re: Dynamic poplulating of TreeView/ListStore
- Date: Fri, 03 Feb 2012 11:59:35 +0100
On Fri, 2012-02-03 at 02:47 -0800, gig-raf wrote:
> i still didn't find a solution for this, and since no one is answering or
> commenting I guess it is either so simple that noone bothers to answer or
> perhaps it is not even possible at all. A third option is that my question
> wasn't clear ;-)
You can create the TreeView::ModelColumn dynamically, and always be
careful to dynamic_cast<> it to the derived type when you read data out.
I do this here, though it's in the middle of some other complicated and
ugly code:
http://git.gnome.org/browse/glom/tree/glom/utility_widgets/adddel/adddel.cc#n559
It's not particularly easy or pretty, I'm afraid.
For some similar code that shows (and edits) a database table, I used a
custom TreeModel. That's not pretty either:
http://git.gnome.org/browse/glom/tree/glom/mode_data/db_adddel/db_adddel.cc
http://git.gnome.org/browse/glom/tree/glom/mode_data/datawidget/treemodel_db.h
> What I want to do can easily be done with Qt,
Well, that part of the Qt API has a lot less compile-time time safety
anyway.
--
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]