#!/usr/bin/env python

import sys

def gi():
    print("Using GObject Introspection")
    from gi.repository import Gtk


    def on_scroll_event(widget, event):
        v, direction = event.get_scroll_direction()
        print(direction)

    icon = Gtk.StatusIcon()
    icon.connect("scroll-event", on_scroll_event)
    Gtk.main()

def pygtk():
    print("Using PyGtk")
    import gtk

    def on_scroll_event(widget, event):
        print(event.direction)

    icon = gtk.StatusIcon()
    icon.connect("scroll-event", on_scroll_event)
    gtk.main()

if __name__ == '__main__':
    if "-p" in sys.argv:
        pygtk()
    else:
        gi()
