Skip to content

Commit

Permalink
Add test script for AppIndicator scroll event (issue #15)
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Jun 16, 2020
1 parent a9a1061 commit 5bdc7da
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions scroll-event-test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import gi

gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
gi.require_version("AppIndicator3", "0.1")
from gi.repository import AppIndicator3


APPINDICATOR_ID = "scroll-event-test"

indicator = AppIndicator3.Indicator.new(APPINDICATOR_ID, "audio-headphones", AppIndicator3.IndicatorCategory.HARDWARE)
indicator.set_status(AppIndicator3.IndicatorStatus.ACTIVE)


menu = Gtk.Menu()
item_quit = Gtk.MenuItem(label="Quit")
item_quit.connect("activate", lambda _: Gtk.main_quit())
menu.append(item_quit)
menu.show_all()
indicator.set_menu(menu)


def scroll_event(indicator, steps, direction):
print(indicator, steps, direction)


indicator.connect("scroll-event", scroll_event)


Gtk.main()

0 comments on commit 5bdc7da

Please sign in to comment.