[wxpython-users] Hold shift/ctrl + mouse click?
Søren Nielsen
soren.skou.nielsen at gmail.com
Thu Apr 10 13:12:12 PDT 2008
Perfect! Thanks mike! :)
On Thu, Apr 10, 2008 at 10:02 PM, Mike Driscoll <mdriscoll at co.marshall.ia.u=
s>
wrote:
> S=F8ren Nielsen wrote:
>
> > Hi Mike,
> >
> > Yes Andrea answered my first question, but i'm using a Listbox... so
> > mapping EVT_LEFT_DOWN will break the normal operations of the listbox...
> >
> > How can I extend a listbox to be able to take multiple selections using
> > a shift and left mouse click?
> >
> > Soren
> >
> Soren,
>
> Looks like the wxPython Demo does this. From what I can tell, it looks
> like you need to pass the style wx.LB_EXTENDED. The code looks like this:
>
> self.lb2 =3D wx.ListBox(self, 70, (320, 50), (90, 120), sampleList,
> wx.LB_EXTENDED)
> self.Bind(wx.EVT_LISTBOX, self.EvtMultiListBox, self.lb2)
>
> def EvtMultiListBox(self, event):
> self.log.WriteText('EvtMultiListBox: %s\n' %
> str(self.lb2.GetSelections()))
>
> So in other words, you don't need to bind to a key or to the mouse
> directly. At least, that's my impression. Hope that helps!
>
> Mike Driscoll
>
> Python Extension Building Network
> http:\\www.pythonlibrary.org
>
> Blog
> http:\\blog.pythonlibrary.org
>
>
> _______________________________________________
> wxpython-users mailing list
> wxpython-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200804=
10/36ea9fc4/attachment.htm
More information about the wxpython-users
mailing list