BlinkenArea - GitList
Repositories
Blog
Wiki
stage_director
Code
Commits
Branches
Tags
Search
Tree:
0a9963d
Branches
Tags
master
stage_director
sync_gui.py
initial PyGtk window
Stefan Schuermans
commited
0a9963d
at 2013-11-14 20:34:28
sync_gui.py
Blame
History
Raw
#! /usr/bin/env python import os from gi.repository import Gtk scriptdir = os.path.dirname(os.path.abspath(__file__)) class SyncGui: def __init__(self): self.builder = Gtk.Builder() self.builder.add_from_file(scriptdir + "/sync_gui.glade") self.position = self.builder.get_object("Position") self.btnPause = self.builder.get_object("Pause") self.btnPlay = self.builder.get_object("Play") self.status = self.builder.get_object("Status") handlers = { "onDestroy": self.onDestroy, "onPrevious": self.onPrevious, "onBackward": self.onBackward, "onStop": self.onStop, "onPause": self.onPause, "onPlay": self.onPlay, "onForward": self.onForward, "onNext": self.onNext, } self.builder.connect_signals(handlers) self.status.push(0, "TODO...") def onDestroy(self, widget): Gtk.main_quit() def onPrevious(self, widget): print("previous") def onBackward(self, widget): print("backward") def onStop(self, widget): print("stop") self.btnPause.set_visible(False) self.btnPlay.set_visible(True) def onPause(self, widget): print("pause") self.btnPause.set_visible(False) self.btnPlay.set_visible(True) def onPlay(self, widget): print("play") self.btnPause.set_visible(True) self.btnPlay.set_visible(False) def onForward(self, widget): print("forward") def onNext(self, widget): print("next") if __name__ == "__main__": app = SyncGui() Gtk.main()