Question #678874 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678874
Status: Solved => Open Rainer is still having a problem: Not a problem. I just was not aware of this behavior, because the SCREEN object is described everywhere as "constant". I noticed an unexpected behavior of a function (that uses the SCREEN object) that is called from different modules, although I had not changed anything in that function. It took me some time to realize that the difference came from the fact that on this one occasion I call this function from within a with: block, which changed the SCREEN region. Now that we know this, we can even use it to our advantage – we don't need to transfer the with: region as a parameter to the called function. The SCREEN "constant" takes care of that. The whole screen can still be accessed by Screen(0), and it is of course always possible to assign SCREEN or Screen(0) to a separate variable and then use this variable as reference to the whole screen. So in my opinion there is no need to change that behavior. One more question: I did some additional testing. The following code: print("1", SCREEN) with Region(1,1,1,1): print("2", SCREEN) with Region(2,2,2,2): print("3", SCREEN) print("4", SCREEN) print("5", SCREEN) results in ('1', R[0,0 1680x1050]@S(0)) ('2', R[1,1 1x1]@S(0)) ('3', R[2,2 2x2]@S(0)) ('4', R[0,0 1680x1050]@S(0)) ('5', R[0,0 1680x1050]@S(0)) Obvioulsy the with: blocks cannot really be nested – otherwise "4" should be back to (1,1,1,1) again … Is this the intended behavior? -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. _______________________________________________ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp