On 06/19/2016 02:03 AM, captaindet wrote:

you mean a ListStore/TreeView combination?

yes.

well i was hoping i could avoid the extra complexity of a full blown
data/view model. being forced to, i gave it a try now:

  • good news, it does not crash on large data sets, i tried up to 256x256

matrices alright

  • even better news, memory consumption is very reasonable, much lower

than for the grid approach

  • however, performance is completely unacceptable. it takes more than 3

seconds to prepare a 256x256 matrix in ListStore/TreeView and more than
17 seconds for a 512x512. about 10% of the time goes to filling the
ListStore, while 90% is taken for building a TreeView from the model.
also, it hardly makes a difference if in debug or release mode or if the
GC is disabled during the ListStore/TreeView construction.

  • not that it matters for my current use case but out of curiosity: how

can the TreeView be configured to not highlight a row? i would want to
select individual cells, never rows or columns.

You would have to implement some of the selection logic your self:
http://www.gtkforums.com/viewtopic.php?p=7354

so it really seems to be the worst case scenario: i'll have to roll my
own (lightweight) spreadsheet. as in figuring out how many rows/columns
fit in the current widget space, arrange them (probably as grid of
selectable labels), manage my own scrollbars, manually change the data
on display in response to the scroll position...just to display a simple
data matrix. this sucks big time :(

You might want to look at a custom tree model for that case:
https://github.com/gtkd-developers/GtkD/tree/master/demos/gtkD/DemoCustomList

The demo only implements a simple list stored in an internal array.
But the TreeView only queries the visible rows, so that would hopefully
help with the performance. Additionally the data to be displayed can be
queried from where it is actually stored instead of building a separate
list beforehand.