| 1 |
"""prompt_toolkit input hook for GTK 3""" |
| 2 |
|
| 3 |
from gi.repository import Gtk, GLib |
| 4 |
|
| 5 |
|
| 6 |
def _main_quit(*args, **kwargs): |
| 7 |
Gtk.main_quit() |
| 8 |
return False |
| 9 |
|
| 10 |
|
| 11 |
def inputhook(context): |
| 12 |
GLib.io_add_watch(context.fileno(), GLib.PRIORITY_DEFAULT, GLib.IO_IN, _main_quit) |
| 13 |
Gtk.main() |