mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-06 08:55:34 +00:00
16 lines
409 B
Python
16 lines
409 B
Python
#!/usr/bin/python3
|
|
|
|
import gi
|
|
|
|
gi.require_version('Gtk', '3.0')
|
|
from gi.repository import Gtk
|
|
|
|
|
|
def bind_accelerator(accelerators, widget, accelerator, signal='clicked'):
|
|
key, mod = Gtk.accelerator_parse(accelerator)
|
|
widget.add_accelerator(signal, accelerators, key, mod, Gtk.AccelFlags.VISIBLE)
|
|
|
|
|
|
def init_accel(win):
|
|
win.accelerators = Gtk.AccelGroup()
|
|
win.add_accel_group(win.accelerators)
|