← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #268494]: Why do I need to call highlight two times

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
ok, sorry for being blind:

- a highlight is per Region
- each highlight() (no parameters) toggles the highlight on and off

screen.setRect(x,y,w,h) does not define a new Region (the Region still
is screen, but it's actual position and dimension is changed)

So if you want to have more than one highlight visible at a time, you
need different regions:

Region.create(x1, y1, w1, h1).highlight();
popup("check 1");
Region.create(x2, y2, w2, h2).highlight();
popup("check 2");
org.sikuli.util.ScreenHighlighter.closeAll() # switch both off

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