[wxPython-users] RE: GridWindow
Raffaello Barella
barbarossa.platz at gmail.com
Tue Mar 18 09:33:39 PDT 2008
Thanks, Mike, your code suits my purpose. Since my idea is to put some
explaining tooltip where the column is too narrow to host a meaningful
label, I just replaced your line
"if pos > 130 and pos < 180:"
with
"col =3D self.grid.XToCol(pos)
if col =3D=3D 2: " and so on.
Ciao.
2008/3/18, Mike Driscoll <mdriscoll at co.marshall.ia.us>:
>
> Raffaello,
>
> > -----Original Message-----
> > From: Raffaello Barella [mailto:barbarossa.platz at gmail.com]
> > Sent: Monday, March 17, 2008 2:31 PM
> > To: Forum utenti WxWidgedts
> > Subject: GridWindow
> >
> > For Robin:
> >
>
> Robin's not the only person that can answer questions...his are just
> usually the most authoratative... :)
>
> >
> > 1. Is it correct to construe the grid window as the grid's "face"?
>
> Not sure
>
> > 2. Where can documentation for GridWindow be found?
>
> http://www.wxpython.org/docs/api/wx.grid.Grid-class.html
> http://wiki.wxpython.org/RecipesControls
>
> > 3. Is there a way to put a tooltip on a single grid column
>
> > label (which, I suppose, is out of the grid window)?
>
>
> I do this sort of thing in one of my programs. Something like this should
> work:
>
> <code>
>
> self.myGrid.GetGridColLabelWindow().Bind(wx.EVT_MOTION, self.onMouseOver)
>
> # For some reason the tooltip has to start out as an empty string
> self.tooltip =3D ""
>
> def onMouseOver(self, event):
> '''
> When the mouse is hovered over certain columns, a tooltip will be
> displayed to give the user more information about what data should
> go into that specific column
> '''
> pos =3D event.GetX()
>
> if pos > 130 and pos < 180:
> if self.tooltip !=3D 'SomeMessage':
>
> self.myGrid.GetGridColLabelWindow().SetToolTipString('SomeMessage')
> self.tooltip =3D 'SomeMessage'
>
> </code>
>
> The above code assumes that you can see the entire grid (i.e. no
> scrollbars). Otherwise, you'll need to take the code from here and modify
> it slightly to support columns:
> http://wiki.wxpython.org/wxGrid%20ToolTips
>
> That code in the wiki looks a lot like something Robin and I hammered out
> a little over a week ago.
>
> >
> > Thanks in advance.
> >
> >
>
>
> Mike
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200803=
18/f98849d4/attachment.htm
More information about the wxpython-users
mailing list