Reputation: 13
I am trying to sort columns in wxPython grids and for that I want to run a function when there is a left click in a column header. Now what is the right hierarchy to process the event and how would you run the function once it happens?
The class HeaderCtrl has the method EVT_HEADER_CLICK, but how can I include this method in my binds?
self.Bind(wx.EVT_HEADER_CLICK,self.sortData)
Upvotes: 0
Views: 568
Reputation: 809
I think you want to use the wx.Grid.EVT_GRID_LABEL_LEFT_CLICK
event.
See: http://www.blog.pythonlibrary.org/2010/04/04/wxpython-grid-tips-and-tricks/
Upvotes: 1