Commit c8312e17c2cbce1c3399784005ace88059c84b36
1 parent
18762534
Exists in
master
and in
38 other branches
fixed problem with surface indexes in combobox
Showing
1 changed file
with
5 additions
and
2 deletions
Show diff stats
invesalius/gui/task_surface.py
| ... | ... | @@ -477,9 +477,11 @@ class SurfaceProperties(wx.Panel): |
| 477 | 477 | |
| 478 | 478 | old_dict = self.surface_list |
| 479 | 479 | new_dict = [] |
| 480 | + i = 0 | |
| 480 | 481 | for n, (name, index) in enumerate(old_dict): |
| 481 | 482 | if n not in list_index: |
| 482 | - new_dict.append([name, index]) | |
| 483 | + new_dict.append([name, i]) | |
| 484 | + i+=1 | |
| 483 | 485 | self.surface_list = new_dict |
| 484 | 486 | |
| 485 | 487 | s = self.combo_surface_name.GetSelection() |
| ... | ... | @@ -510,6 +512,7 @@ class SurfaceProperties(wx.Panel): |
| 510 | 512 | name = pubsub_evt.data[1] |
| 511 | 513 | colour = [value*255 for value in pubsub_evt.data[2]] |
| 512 | 514 | i = 0 |
| 515 | + print name, index, self.surface_list | |
| 513 | 516 | try: |
| 514 | 517 | i = self.surface_list.index([name, index]) |
| 515 | 518 | overwrite = True |
| ... | ... | @@ -532,7 +535,7 @@ class SurfaceProperties(wx.Panel): |
| 532 | 535 | def OnComboName(self, evt): |
| 533 | 536 | surface_name = evt.GetString() |
| 534 | 537 | surface_index = evt.GetSelection() |
| 535 | - Publisher.sendMessage('Change surface selected', surface_index) | |
| 538 | + Publisher.sendMessage('Change surface selected', self.surface_list[surface_index][1]) | |
| 536 | 539 | |
| 537 | 540 | def OnSelectColour(self, evt): |
| 538 | 541 | colour = [value/255.0 for value in evt.GetValue()] | ... | ... |