← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #261426]: Region.observe(60, True) is throwing an exception

 

Question #261426 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/261426

    Status: Open => Answered

RaiMan proposed the following answer:
I removed the debug log, since this does not help.

More helpful would be to see the code you are using (just the relevant
snippet).

And since you are working with PyCharm and probably running with this
IDE, you setup would shed some light on your problem.

Might be that this already helps:

This works:

reg = Region(0, 20, 300, 200)
reg.highlight(2)

def handler(e):
  global shouldStop
  print "changed"
  e.stopObserver()
  shouldStop = True

reg.onChange(100, handler) # upper left where a menu will appear when I click there
switchApp("Safari") # get some app in foreground
wait(1)
shouldStop = False
reg.observe(background = True) # observing forever in background

while not shouldStop: # wait until I have clicked a menu, that opens into the reg and triggers the handler
  wait(1)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.