Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 74aeb10 commit bcd1e1cCopy full SHA for bcd1e1c
1 file changed
examples/user_interfaces/svg_tooltip.py
@@ -65,12 +65,14 @@
65
tree, xmlid = ET.XMLID(f.getvalue())
66
tree.set('onload', 'init(evt)')
67
68
-for i in enumerate(shapes):
+for i in shapes:
69
+ # Get the index of the shape
70
+ index = shapes.index(i)
71
# Hide the tooltips
- tooltip = xmlid['mytooltip_{:03d}'.format(i[0])]
72
+ tooltip = xmlid['mytooltip_{:03d}'.format(index)]
73
tooltip.set('visibility', 'hidden')
74
# Assign onmouseover and onmouseout callbacks to patches.
- mypatch = xmlid['mypatch_{:03d}'.format(i[0])]
75
+ mypatch = xmlid['mypatch_{:03d}'.format(index)]
76
mypatch.set('onmouseover', "ShowTooltip(this)")
77
mypatch.set('onmouseout', "HideTooltip(this)")
78
0 commit comments