Commit 11f86f5a95ba283796570f23144c5f382de8cfd0
1 parent
28147eb5
Exists in
master
and in
68 other branches
ENC: Select first item on treelistctrl on import panel
Showing
1 changed file
with
7 additions
and
1 deletions
Show diff stats
invesalius/gui/import_panel.py
@@ -93,7 +93,8 @@ class TextPanel(wx.Panel): | @@ -93,7 +93,8 @@ class TextPanel(wx.Panel): | ||
93 | 93 | ||
94 | def Populate(self, patient_list): | 94 | def Populate(self, patient_list): |
95 | tree = self.tree | 95 | tree = self.tree |
96 | - | 96 | + |
97 | + first = 0 | ||
97 | for patient in patient_list: | 98 | for patient in patient_list: |
98 | ngroups = patient.ngroups | 99 | ngroups = patient.ngroups |
99 | dicom = patient.GetDicomSample() | 100 | dicom = patient.GetDicomSample() |
@@ -103,6 +104,11 @@ class TextPanel(wx.Panel): | @@ -103,6 +104,11 @@ class TextPanel(wx.Panel): | ||
103 | 104 | ||
104 | parent = tree.AppendItem(self.root, title) | 105 | parent = tree.AppendItem(self.root, title) |
105 | 106 | ||
107 | + if not first: | ||
108 | + tree.SelectItem(parent) | ||
109 | + first += 1 | ||
110 | + | ||
111 | + | ||
106 | tree.SetItemText(parent, str(dicom.patient.id), 1) | 112 | tree.SetItemText(parent, str(dicom.patient.id), 1) |
107 | tree.SetItemText(parent, str(dicom.patient.age), 2) | 113 | tree.SetItemText(parent, str(dicom.patient.age), 2) |
108 | tree.SetItemText(parent, str(dicom.patient.gender), 3) | 114 | tree.SetItemText(parent, str(dicom.patient.gender), 3) |