← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #269185]: OnAppear and OnVanish on the same region

 

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

    Status: Answered => Open

Tetsuo is still having a problem:
Hi,

It doesnt seen to be working. Maybe i misunderstood your tips. Here is
my code:

def myHandler(event):
        if event.isAppear():
            popup("APPEAR")            
            event.region.setInactive(appear_handler)
            event.region.setActive(vanish_handler)
        elif event.isVanish():
            popup("VANISH")
            event.region.setInactive(vanish_handler)
            event.region.setActive(appear_handler)
        event.repeat()

in the main program:

appear_handler = myRegion.onAppear(avatar, myHandler)
vanish_handler = myRegion.onVanish(avatar, myHandler)
myRegion.observe(FOREVER, background=True)

Popup APPEAR keeps showing on screen when the avatar is showing. So i guess setInactive is not working.
Am i doing it righ? Setting it Inactive after repeat does not work either.

Thanks.

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