def dictionary_to_outline(p,dictionary):
'''
Transform a dictionary into the subtree outline of the given position
'''
g.app.gui.frameFactory.masterFrame.currentWidget().leo_c
sorted_keys = sorted([key for key in dictionary])
for key in sorted_keys:
new_node = p.insertAsLastChild().copy()
new_node.h = key
if "dict" in str(type(dictionary[key])):
self.dictionary_to_outline(new_node,dictionary[key])
else:
new_node.b = str(dictionary[key])