← Back to team overview

sikuli-driver team mailing list archive

[Question #269941]: Handling several Region.text()

 

New question #269941 on Sikuli:
https://answers.launchpad.net/sikuli/+question/269941

Hi,

i am french, i will try to be as clear as possible.

I have to scan several regions of text and update the program's variables when a change event occurs. 

I use java with sikuli 1.1.0 api.

// init--> region
Region myRegion = new Region(// ... coordinates ...);

// scan --> region
String myVariable = myRegion.text();

// set --> class variable
myClass.setMyVariable(myVariable)

// set --> region handler
myRegion.onChange(myClass.setMyVariable(myRegion.text));

// start --> region observer
myRegion.observeInBackground(Constants.FOREVER);

Using this pattern on several regions crash the app (access violation), apparently tesseract doesn't like multithreading (observeInBackground).

I could use the while loop to update variables every x seconds in the main thread but i think it's pretty ugly and bloated.

Is there a workaround to accomplish these things in a better way ? (--> scan text --> update program --> waiting for region change) 

Thanks

  





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