Connecting Tech Pros Worldwide Help | Site Map

wxGrid

  #1  
Old June 30th, 2009, 08:51 PM
Subsciber123's Avatar
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.
  #2  
Old June 30th, 2009, 09:57 PM
Subsciber123's Avatar
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.
  #3  
Old June 30th, 2009, 10:02 PM
Subsciber123's Avatar
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.
  #4  
Old July 1st, 2009, 02:29 PM
Subsciber123's Avatar
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.
Reply

Tags
columns, sorting, wxgrid, wxpython


Similar Threads
Thread Thread Starter Forum Replies Last Post
wxGrid and Focus Event lux answers 10 December 5th, 2005 06:15 PM
wxgrid multiline cell editor James answers 1 July 18th, 2005 10:25 PM
wxPython: wxGrid vs. wxListCtrl Piet answers 4 July 18th, 2005 01:23 PM
WxPYTHON GetValue from wxGrid HELP matthiasjanes answers 1 July 18th, 2005 01:09 PM
wxGrid? Tom Lee answers 3 July 18th, 2005 03:14 AM