my code works - take a look - maybe it helps you
class MyGrid(wxGrid):
def __init__(self, parent, dict, table):
(cx,cy) = self.parent.GetSizeTuple() # get size of parent
wxGrid.__init__(self, self.parent, -1, size=(cx,cy))
self.SetSelectionMode(self.wxGridSelectColumns) # TODOX
self.CreateGrid(self.varcnt, self.rowcnt)
self.DoSomething()
EVT_MOTION(self.GetGridWindow(), self.OnMouseMotion)
bye
-----Ursprungliche Nachricht-----
···
Von: Austin Wilson [SMTP:austinw@bigpond.com]
Gesendet am: Samstag, 14. Juli 2001 04:17
An: wxpython-users@lists.wxwindows.org
Betreff: Re: [wxPython] wxToolTip on wxGrid
Hi
I would like to something like this in a project of mine but have been
unable to get it to work. The grid does not seem to respond to the
EVT_MOTION event. Does anyone have any clues as to what I might be doing
wrong?
Thanks
Austin
Von: Robin Dunn [SMTP:robin@alldunn.com]
Gesendet am: Donnerstag, 28. Juni 2001 01:49
An: wxpython-users@lists.wxwindows.org
Betreff: Re: [wxPython] wxToolTip on wxGridI want to show a
ToolTip on a wxGrid Window. (plattform Windows an Linux )Depending on the Row where the mouse is, i want to show
different ToolTip Strings (multiple lines) .which Events do i have to implement ?
Something like this maybe, (where self is a grid):
EVT_MOTION(self.GetGridWindow(), self.OnMouseMotion)
def OnMouseMotion(self, evt):
x, y = evt.GetPosition()
row = self.YToRow(y)
col = self.XToCol(x)
self.GetGridWindow().SetToolTipString(
"Here is the ToolTip for (%d, %d)" % (row, col))
evt.Skip()
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users