Disallowing Grid Row Sizing

Hello all,

I have grids in my app and I want to disallow row resizing by the user.

I tried this:
   self.Bind(wx.grid.EVT_GRID_ROW_SIZE, self.OnResize, self)
   self.Bind(wx.grid.EVT_GRID_CMD_ROW_SIZE, self.OnResize, self)

def OnResize(self, event):
   event.Veto()

This issue with this is sometimes (non-deterministically) row resize
is allowed, though for most part resizing is not allowed.

I also tried:
        self.GetGridWindow().Bind(
            wx/grid.EVT_GRID_ROW_SIZE,
            self.OnRowSize,
            self.GetGridWindow()
        )

from a previous post about EVT_MOTION not working in a grid and same results.

Does anyone have any suggestions as to why row resizing is allowed,
albeit sporadically?

I have another bit of input, that I think might have some bearing on
this (mis)behavior. I have a grid row mixin to enable drag and drop
functionality (adapted from wxPy Wiki) and the mixin (of which my grid
class is a subclass) binds EVT_LEFT_DOWN. Will this interfere with the
Grid row size events?

Thanks,
-Kartic

This (or a similar) problem was reported a while ago as RFE 852379. It may still be an issue if it has not been fixed. Here is a reference to the thread

<http://aspn.activestate.com/ASPN/Mail/Message/wxPython-users/1903839>

/Jean Brouwers

···

On 9/22/05, Kartic Krish kartic0@gmail.com wrote:

Hello all,

I have grids in my app and I want to disallow row resizing by the user.

I tried this:
self.Bind(wx.grid.EVT_GRID_ROW_SIZE, self.OnResize, self)
self.Bind(wx.grid.EVT_GRID_CMD_ROW_SIZE, self.OnResize, self)

def OnResize(self, event):
event.Veto()

This issue with this is sometimes (non-deterministically) row resize
is allowed, though for most part resizing is not allowed.

I also tried:

    self.GetGridWindow().Bind(
        wx/grid.EVT_GRID_ROW_SIZE,
        self.OnRowSize,
        self.GetGridWindow()
    )

from a previous post about EVT_MOTION not working in a grid and same results.

Does anyone have any suggestions as to why row resizing is allowed,
albeit sporadically?

I have another bit of input, that I think might have some bearing on
this (mis)behavior. I have a grid row mixin to enable drag and drop

functionality (adapted from wxPy Wiki) and the mixin (of which my grid
class is a subclass) binds EVT_LEFT_DOWN. Will this interfere with the
Grid row size events?

Thanks,
-Kartic


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org

Kartic Krish wrote:

Hello all,

I have grids in my app and I want to disallow row resizing by
the user.

I tried this:
   self.Bind(wx.grid.EVT_GRID_ROW_SIZE, self.OnResize, self)
   self.Bind(wx.grid.EVT_GRID_CMD_ROW_SIZE, self.OnResize, self)

def OnResize(self, event):
   event.Veto()

This issue with this is sometimes (non-deterministically) row
resize is allowed, though for most part resizing is not allowed.

Maybe I am misunderstanding what you want, but this works for me -

    self.DisableDragRowSize()

Frank Millman

Frank...Thanks, that solved my problem. I had overlooked this method :stuck_out_tongue:

-Kartic

···

Maybe I am misunderstanding what you want, but this works for me -

    self.DisableDragRowSize()

Frank Millman

Thank you for this post. DisableDragRowSize() does precisely what
we needed**. It also prevents the “double arrow” cursor when
moving over row lines.

/Jean Brouwers

**) This is wxpython 2.4.2.4 and Python 2.4 on Redhat Linux FC2.

···

On 9/22/05, Frank Millman frank@chagford.com wrote:

Kartic Krish wrote:

Hello all,

I have grids in my app and I want to disallow row resizing by
the user.

I tried this:
self.Bind(wx.grid.EVT_GRID_ROW_SIZE, self.OnResize, self)
self.Bind(wx.grid.EVT_GRID_CMD_ROW_SIZE, self.OnResize, self)

def OnResize(self, event):
event.Veto()

This issue with this is sometimes (non-deterministically) row

resize is allowed, though for most part resizing is not allowed.

Maybe I am misunderstanding what you want, but this works for me -

self.DisableDragRowSize()

Frank Millman


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org