-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.py
More file actions
34 lines (25 loc) · 741 Bytes
/
Copy pathexample.py
File metadata and controls
34 lines (25 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python
from __future__ import print_function, unicode_literals
import ctypes
from gi.repository import GLib, Gtk
import winmmtaskbar
playing = False
def callback(button, hwnd):
global playing
print(button)
if button == 1:
playing = not playing
winmmtaskbar.set_playing(hwnd, playing)
def main():
Gtk.init()
win = Gtk.Window()
win.connect('destroy', Gtk.main_quit)
win.show()
hwnd = ctypes.WinDLL('libgdk-3-0.dll').gdk_win32_window_get_handle(
hash(win.get_window()))
winmmtaskbar.create_buttons(hwnd,
"Previous", "Play", "Pause", "Next",
callback, hwnd)
Gtk.main()
if __name__ == '__main__':
main()