MCPcopy Index your code
hub / github.com/python/cpython / _undo_delegator

Function _undo_delegator

Lib/idlelib/undo.py:339–359  ·  view source on GitHub ↗
(parent)

Source from the content-addressed store, hash-verified

337
338
339def _undo_delegator(parent): # htest #
340 from tkinter import Toplevel, Text, Button
341 from idlelib.percolator import Percolator
342 top = Toplevel(parent)
343 top.title("Test UndoDelegator")
344 x, y = map(int, parent.geometry().split('+')[1:])
345 top.geometry("+%d+%d" % (x, y + 175))
346
347 text = Text(top, height=10)
348 text.pack()
349 text.focus_set()
350 p = Percolator(text)
351 d = UndoDelegator()
352 p.insertfilter(d)
353
354 undo = Button(top, text="Undo", command=lambda:d.undo_event(None))
355 undo.pack(side='left')
356 redo = Button(top, text="Redo", command=lambda:d.redo_event(None))
357 redo.pack(side='left')
358 dump = Button(top, text="Dump", command=lambda:d.dump_event(None))
359 dump.pack(side='left')
360
361
362if __name__ == "__main__":

Callers

nothing calls this directly

Calls 13

insertfilterMethod · 0.95
undo_eventMethod · 0.95
redo_eventMethod · 0.95
dump_eventMethod · 0.95
ToplevelClass · 0.90
TextClass · 0.90
PercolatorClass · 0.90
ButtonClass · 0.90
UndoDelegatorClass · 0.70
titleMethod · 0.45
splitMethod · 0.45
packMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…