simple wx.grid question

THis is driving me nuts. I can't seem to steal it from boa constructor and
the examples are not helping... The best I can seem to do is put something in __init__controls and __init__ but it crashes and I am not figuring out what is missing
I am just trying to bind a button click (I probily want the right one though). I am also intrested in those menu's people
have come up but I might be able to figure that one out. Any help is apreaciated thanks for your time (hopefully I get a job soon so I can buy the book)

Code: [Download]

import wx
import wx.grid as gridlib
import sys

···

#---------------------------------------------------------------------------

class WordGrid(gridlib.Grid):
    def _init_ctrls(self, parent, log):
        #self.Bind(Grid.EVT_GRID_LABEL_RIGHT_CLICK, self.OnLabelRightClicked)
        self.Bind(WordGrid.EVT_LEFT_DCLICK, self.OnGrid1LeftDclick)

    def __init__(self, parent, log):
        #self._init_ctrls(parent, log)
        gridlib.Grid.__init__(self, parent, -1)
        self._init_ctrls(parent, log)
        self.loadFile()

https://sourceforge.net/project/showfiles.php?group_id=156455

_________________________________________________________________
Try the next generation of search with Windows Live Search today! http://imagine-windowslive.com/minisites/searchlaunch/?locale=en-us&source=hmtagline

Eric Dexter wrote:

THis is driving me nuts. I can't seem to steal it from boa constructor and
the examples are not helping... The best I can seem to do is put something in __init__controls and __init__ but it crashes and I am not figuring out what is missing
I am just trying to bind a button click (I probily want the right one though). I am also intrested in those menu's people
have come up but I might be able to figure that one out. Any help is apreaciated thanks for your time (hopefully I get a job soon so I can buy the book)

class WordGrid(gridlib.Grid):
   def _init_ctrls(self, parent, log):
       #self.Bind(Grid.EVT_GRID_LABEL_RIGHT_CLICK, self.OnLabelRightClicked)
       self.Bind(WordGrid.EVT_LEFT_DCLICK, self.OnGrid1LeftDclick)

AS mentioned in other recent messages, if you want to catch the low level events from a grid then you need to bind to the actual component windows. IOW, the return value of self.GetGridWindow(), self.GetGridRowLabelWindow(), etc.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!