By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,345 Members | 1,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,345 IT Pros & Developers. It's quick & easy.


P: 87
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.

Jun 30 '09 #1
Share this Question
Share on Google+
3 Replies

P: 87
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.
Jun 30 '09 #2

P: 87
Ah. It's wxGrid.GetColPos()

Okay, what about that event? I need to know when the column position changes.

Thanks in advance.
Jun 30 '09 #3

P: 87
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.
Jul 1 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.