--- a/Viewer.py Fri Jan 09 17:11:09 2009 +0100
+++ b/Viewer.py Mon Jan 12 09:41:47 2009 +0100
@@ -176,15 +176,14 @@
wx.CallAfter(self.ShowMessage, message)
def GenerateTreeMenu(self, x, y, scaling, menu, base_path, var_class, tree):
- for child_name, child_type, child_tree in tree:
+ for child_name, child_type, (child_tree, child_dimensions) in tree:
if base_path:
child_path = "%s.%s" % (base_path, child_name)
else:
child_path = child_name
- if len(child_tree) == 1 and isinstance(child_tree[0], ListType):
- child_path += "[0]"
+ if len(child_dimensions) > 0:
+ child_path += "[%s]" % ",".join([str(dimension[0]) for dimension in child_dimensions])
child_name += "[]"
- child_tree = child_tree[0]
new_id = wx.NewId()
AppendMenu(menu, help='', id=new_id, kind=wx.ITEM_NORMAL, text=child_name)
self.ParentWindow.Bind(wx.EVT_MENU, self.GetAddVariableBlockFunction(x, y, scaling, var_class, child_path, child_type), id=new_id)