Re: Making a gtktreeview like gtkClist



Carl B. Constantine wrote:
> However, all the examples I've seen so far do NOT address HOW
> to make a Tree into a List (with column Lables and the whole bit).
> 
> Some of the docs I've looked at in the gtk2 reference hint at it using , but
> no real solid example that runs as-is.

Column labels and the whole bit are handled identically for trees
and lists. The procedure, in brief, for creating a list and
presenting it is 
1) Define and populate a GtkListStore
2) Associate a GtkTreeView with it
3) Create a GtkTreeViewColumn and a GtkCellRenderer (which will 
handle the style for the column)  Hint: The column label
gets set here
4) Append the GtkTreeViewColumn to the GtkTreeView
5) Go to 3 until there are no columns left to do
6) Display the GtkTreeView in any container widget.

> Also, how does one convert existing gtk 1.2 CList into a gtk 2.x
> TreeView?

This is a little more complicated - because of the separation of
content and style, this isn't always easy. Basically, replace
your definition of the style part of the CList with appropriate
stuff in the GtkTreeView and do the content parts in a
GtkListStore.

Cheers,
Dave.

-- 
David Neary,
E-Mail: dneary wanadoo fr
Tél: 04 91 72 46 84
CV: http://www.redbrick.dcu.ie/~bolsh/CV/



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