← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #234486]: Region area manipulation. How does that work?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Region(reg.x, reg.y, reg.h, reg.w)

creates a new region and the constructor does not use named parameters but positional parameters:
- first value will be the x value of the new region
- second the y value
- third the width value
- forth the height value

reg.x ... reg.h on the other hand are named region attributes, allowing
you to reference the respective value of the region reg.

In
Region(reg.x, reg.y, reg.h, reg.w)
these values are grabbed from the region reg and given to the constructor of the new region as simple integer numbers. So how should the constructor know, that the third value given has been a height value before?

BTW: the problem would never have come up with this:
regN = Region(reg)

... which would have been the right way, since you wanted the new region
to have the same vlues as the old one.


*** @ comment #2:
T: shows the regions current default wait timeout (3 in the standard)
E: shows the regions current setting about "should throw FindFailed on image not found" (Y = yes in the standard, N = no, do not throw)

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