PHP-GTK2 Newsletter
|
Sample Code 27: How to display a 2D array in GtkTreeView - Part 1? |
| Written by kksou | ||||||
| Thursday, 21 September 2006 | ||||||
|
Problem GtkTreeView is an extremely useful widgets to display both a list view as well as a tree structure. This article introduces the basics of setting up a treeview. We will display a 2D array in a list view as shown below:
Solution To display data in a treeview, the standard steps are:
Sample Code
Explanation The way to display a list is very different between PHP-GTK1 and PHP-GTK2. PHP-GTK2 adopts the data-view concept. The data is stored is a data model (e.g. GtkListStore or GtkTreeStore), and we create a view to display the data.
Note
Yes, I know you must have noticed that there are many rooms for improvements for the above list view:
Related Links
|
||||||
| < Prev | Next > |
|---|




