def realize_cb(self, widget):
        self.activity.add_events(Gdk.EventMask.KEY_PRESS_MASK)
        self.key_press_cb_id = self.activity.connect('key-press-event', self.key_cb)

        # Clear the mouse cursor. 
        #pixmap = Gdk.Pixmap(widget.window, 10, 10)
        #color = Gdk.Color()
        #cursor = Gdk.Cursor.new(pixmap, pixmap, color, color, 5, 5)
        #widget.window.set_cursor(cursor)