PHP-GTK2 Cookbook Forum
Welcome, Guest
Please Login or Register.    Lost Password?
GTKTreeView merged cells (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: GTKTreeView merged cells
#921
sutterp (User)
Fresh Boarder
Posts: 19
graphgraph
User Offline Click here to see the profile of this user
GTKTreeView merged cells 3 Months ago Karma: 0  
I have a GtkTreeView with a GtkListStore as model. Is it possible to have horizontally 'merged' cells, i.e. a cell spanning several columns? If yes, how would I go about it?

Similarly, I would need two heading rows, like in the following example of tyre pressure readings

Code:
+-----------------------------+
|    Front     |    Rear      | 
| Left | Right | Left | Right | 
+------+-------+------+-------+
|  30  |  35   |  40  |   41  |
+--------------+--------------+
|     30       |     40       |
+--------------+--------------+       
or for a planner
Code:
+---------+-------------------------------+--------------------------------+
|         |          2008-10-01           |           2008-10-02           |
+ Vehicle +-------------------------------+--------------------------------+
|         | 00-06 | 06-12 | 12-18 | 18-24 |  00-06 | 06-12 | 12-18 | 18-24 |
+---------+-------+-------+-------+-------+--------+-------+-------+-------+
| M1      |   -   | Peter | Joe   |   -   |   -    | Peter | David |   -   |
+---------+-------+-------+-------+-------+--------+-------+-------+-------+
| M2      | Roger |         Keith         |       Paul     |     Harry     |
+---------+-------+-------+-------+-------+--------+-------+-------+-------+
I have tried to implement this using GtkTable and it works fine except the screen takes too long to draw, 40 seconds+ for a large table; GtkTreeView handles the same much much faster. Thanks Peter
 
 
Last Edit: 2008/10/04 12:57 By sutterp.
  The administrator has disabled public write access.
#925
kksou (Admin)
Admin
Posts: 443
graph
User Online Now Click here to see the profile of this user
Re:GTKTreeView merged cells 3 Months ago Karma: 8  
Hi Peter,

Please take a look at the following:
http://www.nabble.com/GtkTreeView-colspan%2C-rowspan-ts9729884.html

You could probably try it. But it might not be that striaghtforward...

Have you thought about using a GtkTable instead? With a GtkTable, it will be very easy to do a column or row span.

And, if yours is a long table, you can even stuff the table into a GtkScrolledWindow with the method GtkScrolledWindow::add_with_viewport().

Regards,
/kksou
 
  The administrator has disabled public write access.
#928
sutterp (User)
Fresh Boarder
Posts: 19
graphgraph
User Offline Click here to see the profile of this user
Re:GTKTreeView merged cells 3 Months ago Karma: 0  
Thanks kksou,

I was afraid you would say so.

I have tried to implement this using GtkTable and it works fine except the screen takes too long to draw, 40 seconds+ for a large table; GtkTreeView handles the same much much faster.

It appears that GtkTable is closer to giving me what I actually need, however the initial startup time of the program seems to exponentially grow with the number of columns in the GtkTable. I have 75 columns (2 for the vehicle identification + 3 days hourly slots + a hidden one) and approximately 60 rows. This takes over a minute for the initial display to appear, although the refresh is reasonably quick; but nothing compared to what I experience with GtkTreeView where it is almost instantaneous.

Peter
 
  The administrator has disabled public write access.
#929
kksou (Admin)
Admin
Posts: 443
graph
User Online Now Click here to see the profile of this user
Re:GTKTreeView merged cells 3 Months ago Karma: 8  
Hi Peter,

75 * 60 is not big. And a minute is definitely way too long.

I was actually quite surprised by the result using GtkTable. I've been using PHP-GTK for quite some time. It has always been reasonably fast.

I don't mind doing some "debugging" for you to see if there's anything weird in the way the tables are built up. However, since you have the data, could you please create a simple standalone program that populates a 75 * 60 GtkTable with spanning for some of the columns. If possible, put them into array instead of from mysql db, something like

Sample Code 20: How to display a 2D array in table - Part 3?

would be great.

Once you have the program, please email me. And I'll do the rest.

Regards,
/kksou
 
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Blog - Forum - Privacy Policy - Contact Us
Copyright © 2006-2009. kksou.com. All Rights Reserved