Did you also put the grid in row selection mode? Something like this:
self.SetSelectionMode(wx.grid.Grid.SelectRows)
> And it doesn't work, but if I comment out line event.Skip(), it works fine.
> Well, not quite, because it disables editing the cell.
>
Correct. You'll also disable anything else that is triggered by mouse
clicks. So instead of hooking in at the mouse event level I would let
the grid do all it wants with the mouse and do the row selection from
the EVT_GRID_SELECT_CELL higher-level event instead.
self.Bind(wx.grid.EVT_GRID_SELECT_CELL, self.onSelectCell, self)
def onSelectCell(self, evt):
self.SelectRow(evt.GetRow())
evt.Skip()
--
Robin Dunn
Software Craftsman
http://wxPython.org
--
To unsubscribe, send email to wxPython-user...@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
On Mar 3, 4:22 am, Neven Goršić <neven.gor...@gmail.com> wrote:
> Thank you - it WORKS! :-)
>
> I would still like to know were I did wrong, or why .SelectRow() doesn't
> work with mouse event.
> Where I can find a good (but not too expert) text about wxPython events
> as a next step from the wxPython in Action (event part)?
>
> Thanks again!
>
> Neven
>
Do a search for "event" or "events" on the wxPython wiki. There are a
bunch of pages on the subject.
-------------------
Mike Driscoll
Look at the GridEnterHandler.py in the demo for an example of this.
Sorry, I forgot to mention that we'll need more information to help with
that. What exactly does "it doesn't work" mean? Can you provide a
small runnable sample for people to experiment with?