← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #231495]: highlight (and other region methods?) not working with Region subclass

 

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

    Status: Answered => Open

Matthew Arnold is still having a problem:
I'm not quite sure what you mean by that--

I understand that Region methods return Regions and not MyRegions, so
I've had to add a cast back to MyRegion for any MyRegion override of
Region methods that return Regions.

But regardless of whether or not a Region or a MyRegion is returned,
since MyRegion subclasses Region, they should both be treated the same
way in this case (every MyRegion is a Region). I haven't overwritten any
of Region's methods in this case-- I've only added additional methods

And every Region in this code should be created with a normal
constructor-- I've been building MyRegions from Regions.

Essentially, whenever an operation that requires a Region (eg: find)
works on a MyRegion, it should work, because MyRegions are Regions. And
whenever an operation that requires a MyRegion (eg: pad) works on a
MyRegion, it should work (for obvious reasons).

So I don't quite understand what's going wrong. A MyRegion is a Region,
and Regions highlight() properly. The MyRegion highlight()s properly
too, just using old data (?!?).

That said, I do appreciate these new features-- I have some ideas of my
own which suit my workflow that I'll post later after I get some more
stuff working.

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