2

I'm triying to put dinamically several gtk.Expander inside a gtk.VBox and have a custom widget-label with a gtk.HBox with a gtk.Label and a gtk.Button/gtk.Image inside it to have a delete button, something similar to some list widgets found on MacOS X, for example at Automator (image). Look the close button at the right of the title bar of the expanders: that's just exactly what i would like to have.

The problem is that when i click on the delete gtk.Button/gtk.Image, the expander gets closed or opened, instead of the gtk.Button click/gtk.Image event-notify-release callback being called, so the event is being captured by the gtk.Expander.

I have opened a new question since this problem is similar to the one from Right-Click on a PyGTK Hbox in an Expander but there they didn't found a solution, and also because a better solution would be to find a specific widget for that task (if exists) instead to hack with the expander... :-D

Community
  • 1
  • 1
Piranna
  • 1,697
  • 1
  • 14
  • 16
  • 1
    Could You do it? I'm also interested in this matter. would be really nice if you could add some code and accept it as answer. – Behrooz Oct 01 '15 at 12:46

1 Answers1

1

I would suggest creating your own custom widget, perhaps inheriting from Expander. Here is a tutorial on subclassing widgets in PyGTK.

ptomato
  • 56,175
  • 13
  • 112
  • 165
  • At this moment i'm inheriting from gtk.Expander but by other things related to my project, so it's not new for me :-) I'll take a look to your link and come back with results later (it's a personal project, now i'm working), but it seems very complete and promising... :-) – Piranna Sep 16 '11 at 07:51