On Fri, 2004-07-23 at 07:15, John Gill wrote: > I'm using the TreeView and a ListStore to display tables of data. > > Users often want to sort on a particular column or filter to see a > subset of the values in a particular column. > > The TreeView has excellent support for the former -- I just need to > make the column headers clickable and I pretty much get the sorting > for free. > > For the latter I'd like to have it so that right-click on a column > label will pop up a simple dialog which allows the user to select > which values they want to see. (as an aside, kudos for the latest > gtk which has support for a filtered model, very handy for the > filtering part). > > Unfortunately, it seems that the TreeViewColumn code catches all the > events on the column headers and suppresses all button events apart > from the left click, which gets turned into a 'clicked' event and > activates the sorting. Hmm, well, that's not quite how I would describe the code. It's more GtkButton that keeps propagation from happening. But yes, the end effect is the same. There is no way of getting these events in the public API. Suggestions: 1) You can access column->button directly and connect to ::event or ::button-press-event on that. But that is *not* public API and if it breaks in GTK+-2.6 you and your users get both pieces. 2) Do something else in your interface, submit a bug asking for a ::popup-menu signal to be added to GtkTreeViewColumn. I would suggest 2). Regards, Owen
Attachment:
signature.asc
Description: This is a digitally signed message part