2

I want to get a signal event if somebody click my pixbuf image? How is this possible.

treestore = Gtk.TreeStore()
...
treeview = Gtk.TreeView()
treeview.set_model(self.treestore)

renderer_pixbuf = Gtk.CellRendererPixbuf()
renderer_pixbuf.props.icon_name = 'list-add'
renderer_pixbuf.connect("clicked", self.start_event)  # doesn't work

column_pixbuf = Gtk.TreeViewColumn("Label", renderer_pixbuf)
treeview.append_column(column_pixbuf)

So what is the right way to get this feature?

ikreb
  • 2,133
  • 1
  • 16
  • 35
  • Sorry, maybe I wrong, but I think this is only one question. – ikreb Mar 17 '19 at 15:06
  • So what is the question, how to add a button to a treeview? Or how to connect to a pixbuf clicked signal? – theGtknerd Mar 17 '19 at 22:44
  • 1
    How to connect a pixbuf clicked signal. I removed the other sentence. – ikreb Mar 18 '19 at 11:49
  • 1
    If you are trying to use buttons (or equivalent) in a treeview row, you might want to realize that it is discouraged. See [here](https://ubuntuforums.org/archive/index.php/t-1009065.html) or even one of my other [answers](https://stackoverflow.com/questions/43050975/adding-gtkbutton-to-gtkliststore-with-text-in-gtk). – theGtknerd Mar 19 '19 at 01:46

0 Answers0