sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #40962
Re: [Question #406532]: cant temporarily stop event observations
Question #406532 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/406532
Status: Answered => Open
geo is still having a problem:
Yes, I read it multiple times. It talks about defining and starting the
observer and even stopping it but, not how to restart it properly.
However, I think I got it with your last message of never starting the
observation in the handler. Sooooo would the following code be "legal"
as far as restarting the observer. Below should be a complete program.
regionX = Region(261,453,813,26) #for event handling purposes
regionY =Region(562,532,251,144) #some button
#Set the observations
regionX.onChange(FOREVER, handler)
def handler(evt):
evt.stopObserver() #stops regionX event???
print("in event handler")
while(True):
regionX.observe(FOREVER, background=True) #<-- Is This OK here???? it should return false if event already exist
if regionY.exists("1481068803504.png"):
print("found the button")
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.