Hi *, I create a dialog when the user doubleclicks an item in a
listbox, using the selection to fetch values from a DB to dispaly inside
the dialog.
The problem is that sometimes the item looses the selection state due to
the second click, so I can't get the selection anymore, and when the
dialog opens it's horribly empty.
How can I disable this feature ? I don't need to unselect items.
TIA,
ngw
···
--
checking for life_signs in -lKenny... no
Oh my god, make (1) killed Kenny ! You, bastards !
nicholas_wieland-at-yahoo-dot-it
___________________________________
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB
http://mail.yahoo.it
Nicholas Wieland wrote:
Hi *, I create a dialog when the user doubleclicks an item in a listbox, using the selection to fetch values from a DB to dispaly
inside the dialog. The problem is that sometimes the item looses the
selection state due to the second click, so I can't get the selection
anymore, and when the dialog opens it's horribly empty. How can I
disable this feature ? I don't need to unselect items.
Into the method that process the event, see what item are checked and
see if it has value 1 or 0. If it's 0 and it's the same that the
previous click, set it to 1, if not the same, set the new one.
def __init__():
self.__previousCheck = -1
self.lst = wx.CheckListBox(....)
self.lst.Bind(wx.EVT_CHECKLISTBOX)
def onCheck(self, event):
currSel = event.GetSelection()
if currSel == self.__previousCheck:
self.lst.SetSelecion(currSel)
return
else:
self.__previousCheck = currSel
event.Skip()
I think that can work.
Michele