#!/usr/bin/python

import pyatspi
from gi.repository import Gtk

class HelloWorldApp(Gtk.Application):
    def __init__(self):
        Gtk.Application.__init__(self)
        self.connect("activate", self.onActivate)

    def register(self):
        pyatspi.Registry.registerKeystrokeListener(
            self.onKey,
            mask=range(255),
            kind=(pyatspi.KEY_PRESSED_EVENT, pyatspi.KEY_RELEASED_EVENT))
        pyatspi.Registry.start()

    def onActivate(self, data=None):
        window = Gtk.Window(type=Gtk.WindowType.TOPLEVEL)
        notebook = Gtk.Notebook()
        for i in range(10):
            notebook.append_page(Gtk.Label(), None)

        window.add(notebook)
        window.show_all()
        self.add_window(window)
        self.register()

    def onKey(self, event):
        pass
    
if __name__ == "__main__":
    app = HelloWorldApp()
    app.run(None)
