Jon Nelson wrote:

>On Fri, 15 Mar 2002 14:10:44 +0800
>"James Henstridge" <[EMAIL PROTECTED]> wrote:
>
>>Jon Nelson wrote:
>>
>>>I have no choice.  I can't use the GtkCTree in this instance at all,
>>>and I have tied to Python 1.5.2, gtk 1.2.[6,8] and pygtk 0.6.8 (can't run anything
>>>newer because they require either newer version of gtk or python
>>>than I can provide).  The GtkCTree doesn't support arbitrary levels
>>>of nesting.
>>>
>>Really?  I hadn't noticed that limitation.  Other than being limited to 
>>text and pixmaps in GtkCTree, CTree is almost always the right choice 
>>for 1.2 apps.  If you want something that looks and acts like the old 
>>GtkTree widget, I recommend doing the following:
>>
>>  ctree = gtk.GtkCTree(1, 0)
>>  ctree.column_titles_hide()
>>  ctree.set_column_auto_resize(0, gtk.TRUE)
>>
>>Then add your tree nodes.
>>
>
>What I mean by arbitrary levels of *nesting* is that I don't know
>ahead of time how many items and subitems (subtrees) I need to make.
>I need items capable of expanding and collapsing. Since GtkCTree can only
>handle text and pixmaps, this isn't an option.
>
Not really sure what you want to do that can't be done with ctree.  For 
instance, I might do:
  node1 = ctree.insert_node(None, None, ['node1'], is_leaf=0)  # insert 
a node at toplevel
  node2 = ctree.insert_node(None, None, ['node2'])  # insert a second 
node at toplevel
  node3 = ctree.insert_node(node1, None, ['node3']) # insert a node as a 
child of node1
  node4 = ctree.insert_node(node1, node3, ['node4'], is_leaf=0) # and 
one under node1, before node3
  node5 = ctree.insert_node(node4, None, ['node5'])

This would produce the following tree:
  +-node1
  |  +-node4
  |  |  +-node5
  |  +-node3
  +-node2

Is this not enough?

>
>
>Still.  Back to the original issue. Any idea why the scrollbars won't 
>recognize that they need to be opened until *after* the second time
>it has been populated?
>
Because GtkTree sucks rocks and is really buggy.  This was addressed in 
a previous message.

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to