gtk treeview: place image buttons on rows

前端 未结 3 1820
一个人的身影
一个人的身影 2020-12-19 08:47

For each row in my treeview, I want 4 image buttons next to each other. They will act like radio buttons, with only one being activateable at a time. Each button has an \'on

3条回答
  •  借酒劲吻你
    2020-12-19 09:39

    Have a look at this 'http://www.daa.com.au/pipermail/pygtk/2010-March/018355.html'. It shows you how to make a gtk.CellRendererPixbuf activatable, and able to connect to a click event signal.

    cell = CellRendererPixbufXt()
    cell.connect('clicked', func)
    

    Update

    As pointed out this answer, or the reference given doesn't work as advertised. It's missing the do_activate method, which needs to emit the clicked signal. Once it's done that, then the cell.connect will work.

    Sorry if this answer mislead anyone.

提交回复
热议问题