Sikuli X 1.0rc1: Windows: with Region: not usable

Asked by Danielo

Ok, here is a question about regions.

If i do this:

reg=Region(0,0,800,200)

with reg:
   highlight()

What sould happend? In my opinion the region should be highlighted, but the whole screen is highlighted, this make me thinks that with region doesn't work in any case, and i have to use reg.function() every time.

thank you.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

with: is buggy with X 1.0rc1. do not use it ;-)

Revision history for this message
RaiMan (raimund-hocke) said :
#2

a possible temporary solution is using

reg=Region(0,0,800,200)
#with reg:
setROI(reg) # these 2 statements temporarily simulate the with
if True:
   highlight(2)

If needed you might have to reset the ROI
setROI(getBounds())

Can you help with this problem?

Provide an answer of your own, or ask Danielo for more information if necessary.

To post a message you must log in.