elwc
elwc

Reputation: 1287

How to allow clicking on a pixbuf (image) in a treeview?

I want to make my gtk.CellRendererPixbuf in the treeview clickable so that I can call a function when user clicks on it. Is this possible and how can this be done?

I'm working with PyGTK, but answers in C or PHP or anything else would be acceptable. Thanks.

Upvotes: 3

Views: 980

Answers (1)

liberforce
liberforce

Reputation: 11454

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.

Upvotes: 2

Related Questions