Re: Has anyone been able to force TreeView expander with no children?



Daniel B. Thurman wrote:
David Nec(as <yeti physics muni cz>
(1) The signal is called "row-expanded".

[Dan] Thank you!  But how did you find this signal?

The problem I have is: how do I capture the signal when the
row is expanded?  I posted a follow up on this and it seems
that the key is "row-has-child-toggled", but this does not
seem to work:

self.treeview.connect('row-has-child-toggled', self.on_row_activated)
TypeError: <gtk.TreeView object at 0xb7b9ab6c (GtkTreeView at
0x8df5080)>: unknown signal name: row-has-child-toggled

I have, however tried:
self.treeview.connect('row-activated', self.on_row_activated)

and this works, except that the row has to be mouse
double-clicked, which is not what I want.

I sure wish there is a Python-GTK code somewhere
that I could peruse to resolve my many issues!

I don't use Python, I use Perl. But I sometimes use the Python docs.

You asked Dan how he found the signal. How did you find the one you were
using? That's an oblique question. What I really mean is that
'row-has-child-toggled' is a signal on the model, so why do you expect
it to work on the view?

Are you aware of these python docs:

<http://www.pygtk.org/pygtk2reference/class-gtktreeview.html>
<http://www.pygtk.org/pygtk2reference/class-gtktreemodel.html>

<http://www.pygtk.org/pygtk2tutorial/>
and specifically
<http://www.pygtk.org/pygtk2tutorial/sec-TreeModelInterface.html#sec-TreeModelSignals>
<http://www.pygtk.org/pygtk2tutorial/sec-TreeViewSignals.html>

There's also
<http://scentric.net/tutorial/treeview-tutorial.html>

Cheers, Dave



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