本文整理匯總了Python中Gui.Gui類的典型用法代碼示例。如果您正苦於以下問題:Python Gui類的具體用法?Python Gui怎麽用?Python Gui使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Gui類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: displayPlot
def displayPlot(self, path):
Gui.displayPlot(self, path)
w = QPushButton('Save scores as PNG')
w.clicked.connect(self.saveScoresPng)
self.layout().addWidget(w, 2, 0)
w = QPushButton('Save scores as text file')
w.clicked.connect(self.saveScoresText)
self.layout().addWidget(w, 2, 1)
示例2: quit
def quit(self):
"""Shuts down the World."""
# setting exists tells other threads that the world is gone
self.exists = False
# destroy closes the window
self.destroy()
# quit terminates mainloop (but since mainloop can get called
# recursively, quitting once might not be enough!)
Gui.quit(self)
示例3: Controleur
class Controleur():
def __init__(self):
#TODO self.modele = Modele() + inititalisation du modèle
self.gui = Gui(self.gameLoop)
#TODO self.gui.rafraichir(self.modele.anneCourante, self.modele.planetes,
# len(self.modele.getPlanetesHumains),
# len(self.modele.getPlanetesGubru),
# len(self.modele.getPlanetesCzins)
#)
def gameLoop(self, userAction, coordinates=None):
""" the coordiantes should be tuples """
if userAction == UserActions.VALIDER_DEPLACEMENT:
self.validationDeplacement()
elif userAction == UserActions.VALIDER_TOUR:
self.finTour()
elif userAction == UserActions.SELECT_PLANETE:
self.gestionSelectionPlanete()
elif userAction == UserActions.FLOTTE_CHANGEMEMT:
self.gestionChangementFlotte()
def gestionSelectionPlanete(self):
pass #TODO Gestion Selection Planete
# afficher les informations de la planète sélectionnée selon niveau connaissances
# Si planete == Humain ==> Si on a pas déjà une flotte dans le modèle ==> faire une nouvelle flotte
#self.gui.getNbVaisseaux()
#self.gui.inspecterPlanete(planete.nom, planete.capacite, nbVaisseaux)
pass # Check coordinates (tuples)
def validationDeplacement(self):
pass #TODO validation Deplacement
def finTour(self):
pass #TODO Fin d'un tour
def gestionChangementFlotte(self):
# TODO mettre flotte même nombre que vaisseaux GUI
#print(self.gui.getNbVaisseaux())
pass
def executer(self):
self.gui.run()
示例4: __init__
def __init__(self, delay=0.5, *args, **kwds):
Gui.__init__(self, *args, **kwds)
self.delay = delay
self.title('World')
# keep track of the most recent world
World.current_world = self
# set to False when the user presses quit.
self.exists = True
# list of animals that live in this world.
self.animals = []
示例5: __init__
def __init__(self, filename=None):
Gui.__init__(self)
#self.geometry('1260x800+74+32')
self.filename = filename
self.views = {}
self.w = self
self.threads = []
self.running = False
self.delay = 0.2
self.setup()
self.run_init()
for col in self.cols:
col.create_thread()
示例6: __init__
def __init__(self, debug=False, pedantic=False):
"""Initializes Lumpy.
Args:
debug: boolean that makes the outlines of the frames visible.
pedantic: boolean whether to show aliasing for simple values.
If pedantic is false, simple values are replicated, rather
than, for example, having all references to 1 refer to the
same int object.
"""
Gui.__init__(self, debug)
self.pedantic = pedantic
self.withdraw()
# initially there is no object diagram, no class diagram
# and no representation of the stack.
self.od = None
self.cd = None
self.stack = None
# instance_vars maps from classes to the instance vars
# that are drawn for that class; for opaque classes, it
# is an empty list.
# an instance of an opaque class is shown with a small empty box;
# the contents are not shown.
self.instance_vars = {}
# the following classes are opaque by default
self.opaque_class(Lumpy)
self.opaque_class(object)
self.opaque_class(type(make_thing)) # function
self.opaque_class(Exception)
self.opaque_class(set) # I don't remember why
# any object that belongs to a class in the Tkinter module
# is opaque (the name of the module depends on the Python version)
self.opaque_module(TKINTER_MODULE)
# by default, class objects and module objects are opaque
classobjtype = type(Lumpy)
self.opaque_class(classobjtype)
modtype = type(inspect)
self.opaque_class(modtype)
# the __class__ of a new-style object is a type object.
# when type objects are drawn, show only the __name__
self.opaque_class(type)
self.make_reference()
示例7: appProcess
def appProcess(inputQueeuChannel, outputQueeuChannel, eventLoop, clipboard):
appState = AppState()
put(outputQueeuChannel, appState.requestAddr())
windowState = Gui() # waitingD
terminate = False
itera = 0
step = time.time() # temporal solution
while not (terminate):
# print itera
itera += 1 # for debuging
windowState.updateWindowsAndDraw(appState)
eventLoop.processEvents(
QtCore.QEventLoop.WaitForMoreEvents
) # trigger the all the gui changes and blocks waiting for input, therefore, it is CRITICAL,
# that whenever a new set of elements are added to the queeu, a void event is feeded into the
# event loop, just to awake the thread.
# For safety reasons, only a QThread can concurrently feed the event loop, therefore, the thread
# adding element to the Queue shall be a QThread instead of a normal Thread
if windowState.copy_to_clipboard:
clipboard.setText(appState.lastAddr)
windowState.copy_to_clipboard = False
guiValue, terminate = windowState.getValues()
if not guiValue is None:
print guiValue
commtValue = non_blocking_get(inputQueeuChannel)
appState.updateAppState(commtValue)
output = appState.getValues(guiValue)
if terminate is True:
put(outputQueeuChannel, None)
else:
if output != None: # we pass a None as termination signal
put(outputQueeuChannel, output)
if (time.time() - step >= 15) or (
not (windowState.payment is None)
): # While not async updates we have to poll :(
step = time.time() # TODO: "Delete this and refactoorrrr"
put(outputQueeuChannel, appState.getValues(("RE_SCAN", None)))
示例8: run
def run():
l = dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
gobject.threads_init()
gtk.gdk.threads_init()
if hildonize.IS_FREMANTLE_SUPPORTED:
hildonize.set_application_name("FMRadio")
else:
hildonize.set_application_name(constants.__pretty_app_name__)
gui = Gui()
controller = Player(ui = gui)
gui.controller = controller
gui.load_settings()
gtk.main()
示例9: __init__
def __init__(self, delay=0.5, *args, **kwds):
Gui.__init__(self, *args, **kwds)
self.delay = delay
self.title('World')
# keep track of the most recent world
World.current_world = self
# set to False when the user presses quit.
self.exists = True
# list of animals that live in this world.
self.animals = []
# if the user closes the window, shut down cleanly
self.protocol("WM_DELETE_WINDOW", self.quit)
示例10: __init__
def __init__(self, args=['']):
Gui.__init__(self)
self.parse_args(args)
self.namer = Namer()
self.locals = sim_locals
self.globals = sim_globals
self.views = {}
self.w = self
self.threads = []
self.running = False
self.delay = 0.2
self.setup()
self.run_init()
for col in self.cols:
col.create_thread()
示例11: __init__
def __init__(self, args=['']):
Gui.__init__(self)
self.parse_args(args)
self.namer = Namer()
self.locals = SIM_LOCALS
self.globals = SIM_GLOBALS
# views is a map from a variable name to the row that
# should be updated when the variable changes
self.views = {}
self.w = self
self.threads = []
self.running = False
self.delay = 0.2
self.setup()
self.run_init()
for col in self.cols:
col.create_thread()
示例12: __init__
def __init__(self):
self.my_db = Database('ega.db','user.db')
self.c = {}
root = Tk()
root.geometry("800x300+100+100")
self.my_gui = Gui(self, root)
root.mainloop()
示例13: __init__
def __init__(self):
super(MainWindow, self).__init__()
self.media_object = None
self.current_time = 0
self.totalTime = "00:00:00"
self.audioOutput = Phonon.AudioOutput(Phonon.VideoCategory, self)
self.media_object = Phonon.MediaObject(self)
self.videoUI = QtGui.QWidget()
self.videoWidget = Phonon.VideoWidget(self.videoUI)
Phonon.createPath(self.media_object, self.videoWidget)#link media source with video output
self.media_object.setTickInterval(1000) #1 milliseconds
self.setWindowTitle("A^2_Player")
self.setMinimumSize(500, 500)
Phonon.createPath(self.media_object, self.audioOutput)#link media source with audio output
self.media_object.stateChanged.connect(self.stateChanged)
self.media_object.currentSourceChanged.connect(self.sourceChanged)
self.media_object.finished.connect(self.finished)
self.media_object.tick.connect(self.tick)
self.setupActions()
self.setupMenus()
gui=Gui(self);
window=gui.setupUi()
self.setCentralWidget(window)
self.sources = []
示例14: initGui
def initGui(self):
self.gui = Gui(self.gameLoop)
self.gui.activerValiderDeplacement(False)
self.gui.activerBarreAugmentation(False)
data = {}
data["anneeCourante"] = self.modele.anneeCourante
data["listePlanetes"] = self.modele.planetes
data["nbPlanetesHumain"] = self.modele.getNbPlanetesRace(Races.HUMAIN)
data["nbPlanetesGubru"] = self.modele.getNbPlanetesRace(Races.GUBRU)
data["nbPlanetesCzin"] = self.modele.getNbPlanetesRace(Races.CZIN)
data["selection1"] = None
data["selection2"] = None
data["flottesHumaines"] = None
data["flottes"] = self.modele.flottes
self.gui.rafraichir(data)
示例15: Widok
class Widok(object):
def __init__(self, root, kolejka_zdarzen):
self._kolejka_zdarzen = kolejka_zdarzen
self.root = root
self._gui = Gui(self, root)
self._gui.pack(side='top', fill='both', expand=True)
def wez_makiete(self, makieta):
self._gui.update(makieta)
def wez_inicjalizujaca_makiete(self, makieta):
self._gui.pierwsze_update(makieta)
def _obsluz_zamkniecie_gui(self):
self._kolejka_zdarzen.put(ZdarzenieKoniec())
self.root.destroy()
def obsluz_zdarzenie_oblicz(self):
materialA = self._gui._comboBox.get()
materialB = self._gui._comboBox2.get()
self._kolejka_zdarzen.put(ZdarzenieOblicz(materialA, materialB))