MCPcopy Create free account
hub / github.com/ipython/ipython / enable

Method enable

IPython/lib/inputhook.py:491–519  ·  view source on GitHub ↗

DEPRECATED since IPython 5.0 Enable event loop integration with Tk. Parameters ---------- app : toplevel :class:`Tkinter.Tk` widget, optional. Running toplevel widget to use. If not given, we probe Tk for an existing one, and create a new on

(self, app=None)

Source from the content-addressed store, hash-verified

489@inputhook_manager.register('tk')
490class TkInputHook(InputHookBase):
491 def enable(self, app=None):
492 """DEPRECATED since IPython 5.0
493
494 Enable event loop integration with Tk.
495
496 Parameters
497 ----------
498 app : toplevel :class:`Tkinter.Tk` widget, optional.
499 Running toplevel widget to use. If not given, we probe Tk for an
500 existing one, and create a new one if none is found.
501
502 Notes
503 -----
504 If you have already created a :class:`Tkinter.Tk` object, the only
505 thing done by this method is to register with the
506 :class:`InputHookManager`, since creating that object automatically
507 sets ``PyOS_InputHook``.
508 """
509 warn("This function is deprecated since IPython 5.0 and will be removed in future versions.",
510 DeprecationWarning, stacklevel=2)
511 if app is None:
512 try:
513 from tkinter import Tk # Py 3
514 except ImportError:
515 from Tkinter import Tk # Py 2
516 app = Tk()
517 app.withdraw()
518 self.manager.apps[GUI_TK] = app
519 return app
520
521
522@inputhook_manager.register('glut')

Callers

nothing calls this directly

Calls 1

TkClass · 0.85

Tested by

no test coverage detected