diff --git a/gui/display.py b/gui/display.py index 7bafe4ec0..46c5e05b7 100644 --- a/gui/display.py +++ b/gui/display.py @@ -167,16 +167,13 @@ class Display(wx.ListCtrl): return lastFound + def deselectItems(self): + sel = self.GetFirstSelected() + while sel != -1: + self.SetItemState(sel, 0, wx.LIST_STATE_SELECTED | wx.LIST_STATE_FOCUSED) + sel = self.GetNextSelected(sel) + def populate(self, stuff): - selection = [] - - -# sel = self.GetFirstSelected() -# while sel != -1: -# selection.append(sel) -# sel = self.GetNextSelected(sel) - -# self.DeleteAllItems() if stuff is not None: listItemCount = self.GetItemCount() @@ -197,10 +194,6 @@ class Display(wx.ListCtrl): self.Refresh() - -# for sel in selection: -# self.Select(sel) - def refresh(self, stuff): if stuff == None: return diff --git a/gui/marketBrowser.py b/gui/marketBrowser.py index 0234f8911..06e3e301a 100644 --- a/gui/marketBrowser.py +++ b/gui/marketBrowser.py @@ -332,6 +332,7 @@ class ItemView(d.Display): return (item.metaGroup.parent.name, item.metaGroup.ID , item.name) def populate(self, stuff): + self.deselectItems() stuff.sort(key=self.itemSort) self.active = stuff d.Display.populate(self, stuff)