/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/tree.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/tree.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 217 by bh, Wed Jul 17 10:50:40 2002 UTC revision 218 by bh, Thu Jul 18 12:54:48 2002 UTC
# Line 95  class SessionTreeCtrl(wxTreeCtrl): Line 95  class SessionTreeCtrl(wxTreeCtrl):
95          # select the selected layer          # select the selected layer
96          selected_layer = self.app.interactor.selected_layer          selected_layer = self.app.interactor.selected_layer
97          if selected_layer is not None:          if selected_layer is not None:
98              self.SelectItem(self.layer_to_item[id(selected_layer)])              # One would expect that the selected_layer's id is in
99                # layer_to_item at this point as we've just rebuilt that
100                # mapping completely. However, when a new session is loaded
101                # for instance, it can happen that the tree view is updated
102                # before the interactor in which case selected_layer may be
103                # a layer of the old session.
104                item = self.layer_to_item.get(id(selected_layer))
105                if item is not None:
106                    self.SelectItem(item)
107    
108      def add_items(self, parent, items):      def add_items(self, parent, items):
109          for item in items:          for item in items:

Legend:
Removed from v.217  
changed lines
  Added in v.218

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26