1 # Replacements for getevent() and pollevent(),
2 # and new functions ungetevent() and sync().
5 # Every library module should ideally use this instead of
6 # stdwin.{get,poll}event(), so applications can use the services
7 # of ungetevent() and sync().
13 # Events read ahead are stored in this queue.
18 # Replacement for getevent().
26 return stdwin
.getevent()
29 # Replacement for pollevent().
35 return stdwin
.pollevent()
38 # Push an event back in the queue.
40 def ungetevent(event
):
41 queue
.insert(0, event
)
44 # Synchronize the display. It turns out that this is the way to
45 # force STDWIN to call XSync(), which some (esoteric) applications need.
46 # (This is stronger than just flushing -- it actually waits for a
47 # positive response from the X server on the last command issued.)
51 event
= stdwin
.pollevent()