[ wxwindows-Bugs-1537945 ] wxListCtrl. Extra events when a selection is modified

SourceForge.net noreply at sourceforge.net
Thu Aug 10 02:59:21 PDT 2006


Bugs item #1537945, was opened at 2006-08-10 09:59
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1537945&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxMSW specific
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: David Hughes (forestfield)
Assigned to: Nobody/Anonymous (nobody)
Summary: wxListCtrl. Extra events when a selection is modified

Initial Comment:
This comes from wxPython, where Robin Dunn has produced
a work round.

On Windows if a wxListCtrl item is selected with a
mouse click and the selection is subsequently altered
programatically, when the left button is released a new
selection event occurs which either re-establishes the
original selection or de-selects the new selection,
depending on circumstances.

The work round, in both cases, is to delay the
selection alteration until after the mouse button has
been released. This is done using a wxFuture call that
monitors the mouse left button state and repeats the
wxFuture call for as long as the button is down, then
alters the selection:

[selection handler]
    .
    .
    wx.FutureCall(50, self.AlterSelection, oldidx, newidx) 


    def AlterSelection(self, oldidx, newidx):
        if wx.GetMouseState().LeftDown():
            wx.FutureCall(50, self.AlterSelection,
oldidx, newidx)
        else:
            self.Select(oldidx, False)
            self.Select(newidx, True)
            self.Focus(newidx)


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1537945&group_id=9863




More information about the wx-dev mailing list