我想让我gtk.CellRendererPixbuf
在树视图中可点击,这样当用户点击它时我可以调用一个函数。这可能吗?如何做到这一点?
我正在使用 PyGTK,但 C 或 PHP 或其他任何东西的答案都是可以接受的。谢谢。
The C documentation of GtkCellRenderer states that:
Beyond merely rendering a cell, cell renderers can optionally provide active user interface elements. A cell renderer can be activatable like GtkCellRendererToggle, which toggles when it gets activated by a mouse click, or it can be editable like GtkCellRendererText, which allows the user to edit the text using a GtkEntry. To make a cell renderer activatable or editable, you have to implement the activate or start_editing virtual functions, respectively.
What is unfortunate is that this information is missing from the pyGTK documentation, but the information is available in the activate
signal documentation.