← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #680738]: switchApp()

 

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

RaiMan proposed the following answer:
This thread already is in the Question&Answer area (I switched it from
the bug area earlier).

At top right click "Ask a question" and you will be able to do so ;-)

Your problem:

if oldColor.getRGB() == newColor.RGB():

... left out the "get" at ".RGB" in the right expression.

it must either be:

if oldColor.getRGB() == newColor.getRGB():

or

if oldColor.RGB == newColor.RGB:

The magic behind:

getRGB returns an integer value and is a function (callable) and hence
has to be written as getRGB()

as a Jython-Java convenience you can use .RGB, since at the Java level
there is a so called getter function getRGB() found by Jython.

when writing color.RGB, this already is a value (integer) and hence not
callable, so you have to leave out the brackets.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.