I’ve a function that deletes a selected item from a scrolled panel. As long as I move the mouse to select an item prior to clicking on it - the delete will work. The selected item pops off the display and if there are any additional items they’ll move up to fill the vacancy. However, if I don’t move the mouse after a click and try to delete the new item that appears underneath the mouse pointer nothing happens. I have to move the mouse, even if if it’s only a few pixels in order for the click/delete to work.
def addImageTile(self, evt, fname):
self.scrollCount += 1
tile = makeTile(fname, self.scrollPanel, self.scrollCount)
self.scrollList.append(tile.id)
tile.Bind(wx.EVT_RIGHT_DOWN,
lambda evt,
tmp=(tile.id,tile.GetLabel()):
self.delete(evt,tmp))
self.scrollSizer.Add(tile, 0, wx.ALL, .5)
self.setUpScroll()
self.bottom(evt)
def delete(self, evt, tmp):
p = self.scrollList.index(tmp[0])
self.scrollSizer.Hide(p)
self.scrollSizer.Remove(p)
self.scrollCount -= 1
del self.scrollList[p]
self.setUpScroll()
def setUpScroll(self):
self.scrollPanel.SetupScrolling(
scroll_x=False, scroll_y=True,
rate_x=0, rate_y=4,
scrollToTop=False, scrollIntoView=True)
···
–
You received this message because you are subscribed to the Google Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/c19ca414-c0f3-4ae6-b02f-e7b931994ed2%40googlegroups.com.