mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Replaced MacOS.EnableAppSwitch with MacOS.SchedParams
This commit is contained in:
parent
d3b06a871f
commit
3368cb7763
2 changed files with 5 additions and 5 deletions
|
@ -213,7 +213,7 @@ def test():
|
||||||
"So far, so good!", "Keep on truckin'" )
|
"So far, so good!", "Keep on truckin'" )
|
||||||
bar = ProgressBar("Progress, progress...", 100)
|
bar = ProgressBar("Progress, progress...", 100)
|
||||||
try:
|
try:
|
||||||
appsw = MacOS.EnableAppswitch(0)
|
appsw = MacOS.SchedParams(1, 0)
|
||||||
for i in range(100):
|
for i in range(100):
|
||||||
bar.set(i)
|
bar.set(i)
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
@ -223,7 +223,7 @@ def test():
|
||||||
time.sleep(0.3) # give'em a chance to see the done.
|
time.sleep(0.3) # give'em a chance to see the done.
|
||||||
finally:
|
finally:
|
||||||
del bar
|
del bar
|
||||||
MacOS.EnableAppswitch(appsw)
|
apply(MacOS.SchedParams, appsw)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@ class Application:
|
||||||
|
|
||||||
def mainloop(self, mask = everyEvent, wait = 0):
|
def mainloop(self, mask = everyEvent, wait = 0):
|
||||||
self.quitting = 0
|
self.quitting = 0
|
||||||
saveyield = MacOS.EnableAppswitch(self.yield)
|
saveparams = apply(MacOS.SchedParams, self.schedparams)
|
||||||
try:
|
try:
|
||||||
while not self.quitting:
|
while not self.quitting:
|
||||||
try:
|
try:
|
||||||
|
@ -154,9 +154,9 @@ class Application:
|
||||||
# applications.
|
# applications.
|
||||||
break
|
break
|
||||||
finally:
|
finally:
|
||||||
MacOS.EnableAppswitch(saveyield)
|
apply(MacOS.SchedParams, self.schedparams)
|
||||||
|
|
||||||
yield = -1
|
schedparams = MacOS.SchedParams()
|
||||||
|
|
||||||
def do1event(self, mask = everyEvent, wait = 0):
|
def do1event(self, mask = everyEvent, wait = 0):
|
||||||
ok, event = self.getevent(mask, wait)
|
ok, event = self.getevent(mask, wait)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue