Sikuli code in Sikuli-IDE doesn't appear

Asked by Hiram Landeros on 2020-12-19

I start the program in Sikuli-IDE, it does what it supposed to do. I press the ctrl-F12 to end the program and the program stops as expected, sadly the code window Sikuli doesn't appear until I quit and restart Sikuli. I tried also with break-key (ctrl-cmd-C) and same result. All the menus of Sikuli are available, yet they do not do anything, and the code window doesn't display until Sikuli is restarted.

Sometimes it crashes after I press a menu of Sikuli (after the code execution is terminated and Sikuli doesn't reappear). I haven't been able to determine what makes that every so often it crashes.

Sometimes the menus are not available at all (except the Sikuli one) after the code execution is terminated and Sikuli doesn't reappear. I haven't been able to determine what makes that every so often it becomes unresponsive and need to terminate the program.

Additionally, if I comment out the command wd.observe(), then I can start and end the code as expected, but not when it executes!

Sikuli 2.0.4
MacOS 11.1

This is my test code:
bs = App.focus("testApp")
global wd
wd = bs.window()

def breakHandler(event):
    global loopctl
    loopctl = False

def clickevent1(event):
    global e1
    global e2
    print("Event1", event.getCount())
    ar = event.getRegion()

def clickevent2(event):
    global e1
    global e2
    print("Event2", event.getCount())
    ar = event.getRegion()

global e1
global e2
e1 = wd.onAppear(Pattern("e1.png").similar(0.80), clickevent1)
e2 = wd.onAppear(Pattern("e2.png").similar(0.80), clickevent2)

Env.addHotkey(Key.F12, KeyModifier.CTRL, breakHandler)


global loopctl
loopctl = True

while loopctl:


Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Last query:
Last reply:
Hiram Landeros (gueritol) said : #1

Additionally, if I comment out the 2nd onAppear, then the program behaves as expected. Apparently, with more than 1 onAppear in the region, Sikuli doesn't return after program is halted!

RaiMan (raimund-hocke) said : #2

ok, thanks.

I have to check.

tracked on Github:

Can you help with this problem?

Provide an answer of your own, or ask Hiram Landeros for more information if necessary.

To post a message you must log in.