[1.0] Jython: When call hover function from a region object, it throw a java null pointer exception

Asked by Frank Feng

I'm using the API 1.0 version

I'm running sikuli using Jython and the code is as follows:

region = Sikuli.Region(x,y,w,h) #some region
region.hover(Sikuli.Location(region.getX()/2,0) #This gives me the java null pointer exception

I have no problem using the previous version of Sikuli.
Maybe something changed that I'm not aware of?

Thanks,
Frank

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

This is how the usage of Sikuli in Jython is recommended

from sikuli import *
region = Region(0,100,100,100)
hover(Location(region.x/2, 0))

this works for me, even if the resulting point is outside the screen (moves to 0,0) (Be aware: other than regions, location objects are not checked at creation about being outside any screen).

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

This is how the usage of Sikuli in Jython is recommended

from sikuli import *
region = Region(0,100,100,100)
hover(Location(region.x/2, 0))

this works for me, even if the resulting point is outside the screen (moves to 0,0) (Be aware: other than regions, location objects are not checked at creation about being outside any screen).

Can you help with this problem?

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

To post a message you must log in.