wxGrid 
June 30th, 2009, 08:51 PM
|  | Member | | Join Date: Nov 2006 Location: Eastern Time Zone
Posts: 87
| | |
Hi,
I'm using Python 2.6, and I'm trying to write a gui program that uses wxGrid. I have made it so that the columns can be dragged around to different locations, but I need to bind to an event that tells me when they are moved, and which one moved where. Can anybody help me with this? I don't see any events that jump out at me as being relevant.
Thanks.
| 
June 30th, 2009, 09:57 PM
|  | Member | | Join Date: Nov 2006 Location: Eastern Time Zone
Posts: 87
| | | re: wxGrid
This problem turns out to be even more annoying than I thought.
I just realized that when you drag a column to a different position (say column zero) it retains the same column number (i.e. zero).
I guess that the question now is, if you have a column, how do you tell whether it is to the right or the left of another column within wxGrid?
An event to tell me when someone drags a label around would still be nice.
| 
June 30th, 2009, 10:02 PM
|  | Member | | Join Date: Nov 2006 Location: Eastern Time Zone
Posts: 87
| | | re: wxGrid
Ah. It's wxGrid.GetColPos()
Okay, what about that event? I need to know when the column position changes.
Thanks in advance.
| 
July 1st, 2009, 02:29 PM
|  | Member | | Join Date: Nov 2006 Location: Eastern Time Zone
Posts: 87
| | | re: wxGrid
So far, I've used a dirty hack. I've created a timer with events, and as soon as someone clicks on the title, it starts the timer. When someone drops the title, the next timer event stops the timer and I can make the program do what I want it to do. So much for good form. At least I'm not using threads.
Please post if you have a better way of doing it.
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,662 network members.
|