(parent)
| 170 | |
| 171 | |
| 172 | def _calltip_window(parent): # htest # |
| 173 | from tkinter import Toplevel, Text, LEFT, BOTH |
| 174 | |
| 175 | top = Toplevel(parent) |
| 176 | top.title("Test call-tips") |
| 177 | x, y = map(int, parent.geometry().split('+')[1:]) |
| 178 | top.geometry("250x100+%d+%d" % (x + 175, y + 150)) |
| 179 | text = Text(top) |
| 180 | text.pack(side=LEFT, fill=BOTH, expand=1) |
| 181 | text.insert("insert", "string.split") |
| 182 | top.update() |
| 183 | |
| 184 | calltip = CalltipWindow(text) |
| 185 | def calltip_show(event): |
| 186 | calltip.showtip("(s='Hello world')", "insert", "end") |
| 187 | def calltip_hide(event): |
| 188 | calltip.hidetip() |
| 189 | text.event_add("<<calltip-show>>", "(") |
| 190 | text.event_add("<<calltip-hide>>", ")") |
| 191 | text.bind("<<calltip-show>>", calltip_show) |
| 192 | text.bind("<<calltip-hide>>", calltip_hide) |
| 193 | |
| 194 | text.focus_set() |
| 195 | |
| 196 | |
| 197 | if __name__ == '__main__': |
nothing calls this directly
no test coverage detected
searching dependent graphs…