Fw: TreeModel and TreeView



Thanks for reply, Andrew
 
>В Пнд, 29/01/2007 в 03:44 -0800, Trigve Siver пишет:
>> Thanks for reply, Paul
>>  
>> ... I think that only soultion is with custom TreeModel but if it can
>> be done with some default TreeModel implementation please could you
>> point to some source ...I would be grateful.
>>
>>  
>
>There was some offer to implement custom TreeModel and add it to GTKMM
>library (Jonathon Jongsma <jonathon jongsma gmail com>).
>
>This link supposed to have some source codes (I haven't looked into):
>
>http://download.gna.org/colorscheme/etc/customtreemodel-0.0.1.tar.gz
 
Looks like the link is out of date...
>I would recommend you to use separate thread to open DB connection and
>load data, and just notify model that it's content changed. I've used
>Glib::Dispatcher.
 
>Also, I've used custom cellrenderer to optimize drawing only for my own
>needs.
By loading data do you mean to load the whole table from DB? Because I don't want to load the whole table...only records that need to be displayed...
>The way you may use gtkmm/example:
>
>- use it as helper;
>
>- think of your iterator handling implementation, there you should have
>datarow IDX in sole concordance with Gtk::TreePath (it is very simple
>for ListStore and a bit complicated for TreeStore);
>
>- look at doc files and reimplement all virtual functions of
>Gtk::TreeModel class where you see: "Override and implement this in a
>derived TreeModel class";
>
>- if you need sorting you should derive and reimplement from
>TreeModelSortable as well.
>
>Regards,
>-andrew
 
I'm using gtkmm/example only for testing purpose (Or should I create new model from a scratch? Maybe the example implementation is causing that get_value_func() is called all the time)...The only problem I have encountered was get_value_func() operation, that was called even if only 1 row was visible... I haven't find in doc when get_value_func() is called (only when rendering row?? looks like not).... It would be great if someone can describe which virtual functions are called when... Hope you understand what I want to achieve...
I was hoping that TreeModel works similiar to wxWidgets's wxDataViewListModel (http://www.wxwidgets.org/manuals/stable/wx_wxdataviewlistmodel.html#wxdataviewlistmodel), where GetValue is called when value is needed for displaying.
thanks
 
Trigve


Have a burning question? Go to Yahoo! Answers and get answers from real people who know.

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