The API has evolved since this question was asked, so I decided to post an updated answer. (I came across this while dealing with a similar problem, although in my case I tried to put two buttons in the column heading, not the record).
First, a little background. As mentioned in the question editing, the problem is with the TreeViewColumn structure. The column heading is a button, and when you set_widget , this widget becomes a child of the button. (This can be easily skipped, because the header does not respond like a button, unless you set the column to click with the mouse. Also, the documentation does not help, as it seems that everyone already knows this.) Another cause of the problem How buttons collect events . Unlike most widgets that respond to events, the button does not have its own place in the Gdk.Window hierarchy. Instead, it creates a special event window when it is implemented. The access method for this window depends on the button: get_event_window (differs from the more general get_window and get_parent_window ). This event window is discreetly located above the button, collecting events before they go to the descendants of the button. Therefore, the widget that you put in the column header does not receive the events necessary for interactivity.
The decision made is one way to get around this obstacle, and it was a worthy answer at that time. However, there is now an easier way. (I should mention that this is a GTK + issue, regardless of the language binding used. Personally, I used the C ++ binding. I also looked into the GTK + source files - in C - to confirm that this is the main GTK + behavior, and not some kind of binding artifact .)
1) Find the title button.
If column is a TreeViewColumn, the API to get the button is now simple:
header_button = column.get_button()
The get_button method was added in version 3.0, which was tagged about six months after this question was asked. So close.
2) Propagation of events from the Button to the Entrance.
It took another four years (version 3.18) to simplify this step. A key development was set_pass_through , which can tell the event window to skip events. As the documentation says: "In Internet terminology, this will be called" event-pointer: none. "
def pass_through_event_window(button, event): if not isinstance(button, gtk.Button): raise TypeError("%r is not a gtk.Button" % button) event_window = button.get_event_window() event_window.set_pass_through(True)
The remaining trick is timing. The event window is not created until the button is implemented, so the button is connected to the realize signal of the button in order.
header_button.connect('realize', pass_through_event_window)
And this is it (no step 3). Events will now propagate to Entry or any widget that you place in the column heading.
My apologies if I messed up the syntax; I am translating from a C ++ binding. If there are errors, I would ask the kind Python guru to fix them.