wx.ListCtrlEdit mixin

Hi Andrew,

Here is a hack, right after creating the list add this line:

notebook_listCtrl.curRow = -2

I also suggest catching the EVT_LIST_ITEM_DESELECTED event and doing the same in the event handler (don’t forget to also call event.Skip).

···

On 13/03/2008, Andrew Rekdal asrekdal@comcast.net wrote:

Hello,

I am stumped…

I am working with a two column ListCtrl with Edit mixin and have populated the

ListCtrl.
With need to supress editing of first column I have Vetoed the
EVT_LIST_BEGIN_LABEL_EDIT event in the user defined target function if
event.Column == 0. All works except the first item in the ListCtrl will ignore

mouse events and after testing appears to be selected by default although
without being highlighted.

I am using the following method…


notebook_listCtrl.Bind(wx.EVT_LIST_BEGIN_LABEL_EDIT, self.editProperty,

id=notebook_listCtrl.GetId())

def editProperty(self, event):

   idx = event.GetIndex()
   col = event.Column

   if col == 0:
       event.Veto()
   else:
       event.Skip()

When the list is first populated if I attempt clicking on first item in list eg.
top left item mouse events seem to be ignored although if I click anywhere on
second,third…etc row items they will become selected just fine. Then I can

click on first row item and it can then become selected

Also after first populating (without Veto in place) it requires only only one
mouse click to activate the cell for editing whereas the rest of the rows

require two clicks.

Does anyone know of how to fix this behaviour?
I have attempted to be clear although i am fairly new to programming and to wx
so if I am in posting to the wrong place or if any additional info is needed

please let me know.

Thanks – andrew


To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org

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