← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #260283]: How to create region of image displayed dynamically

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
You might try with the onChange() feature and observe().

a principal approach:

- define a region, large enough to contain the "future" tooltip.
- the reference point can be the current mouse location from hover.
. then go away again with the mouse to be sure the tooltip has vanished again

def handler(e):
    global regTooltip, regTooltipReady
    regTooltip = ... # here you have to evaluate the e.changes
    regTooltipReady = True

reg.onChange(handler)
reg.observe(FOREVER, True) # observe in background
hover(inc) # hover again on plotpoint
regTooltipReady = False # we use this switch to minimise concurrency problems
while not regTooltip: # we wait until the handler is visited and has evaluated the region
    wait(1)
reg.stopObserver()
# now you should have the appropriate region in regTooltip

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