Commit d1d7f9a14849bad93bf02adaeb5d0b954c961fad
1 parent
292e59da
Exists in
master
and in
37 other branches
Fixed problem with combobox in macosx
Showing
1 changed file
with
5 additions
and
5 deletions
Show diff stats
invesalius/gui/task_surface.py
... | ... | @@ -474,6 +474,8 @@ class SurfaceProperties(wx.Panel): |
474 | 474 | |
475 | 475 | def OnRemoveSurfaces(self, pubsub_evt): |
476 | 476 | list_index = pubsub_evt.data |
477 | + s = self.combo_surface_name.GetSelection() | |
478 | + ns = 0 | |
477 | 479 | |
478 | 480 | old_dict = self.surface_list |
479 | 481 | new_dict = [] |
... | ... | @@ -481,17 +483,15 @@ class SurfaceProperties(wx.Panel): |
481 | 483 | for n, (name, index) in enumerate(old_dict): |
482 | 484 | if n not in list_index: |
483 | 485 | new_dict.append([name, i]) |
486 | + if s == n: | |
487 | + ns = i | |
484 | 488 | i+=1 |
485 | 489 | self.surface_list = new_dict |
486 | 490 | |
487 | - s = self.combo_surface_name.GetSelection() | |
488 | 491 | self.combo_surface_name.SetItems([n[0] for n in self.surface_list]) |
489 | 492 | |
490 | 493 | if self.surface_list: |
491 | - if s in list_index: | |
492 | - self.combo_surface_name.SetSelection(0) | |
493 | - else: | |
494 | - self.combo_surface_name.SetSelection(s) | |
494 | + self.combo_surface_name.SetSelection(ns) | |
495 | 495 | |
496 | 496 | def OnCloseProject(self, pubsub_evt): |
497 | 497 | self.CloseProject() | ... | ... |