Do.popup() returns incorrectly

Asked by Mike

This code displays the mouse position until OK is pressed:

def locationDisplay():
    lcount = 0
    while True:
        mouseposition =
        print mouseposition
        mslx = str(mouseposition.x)
        msly = str(mouseposition.y)
        bmsg = "Location is " + mslx + "," + msly + " Loop:" + str(lcount)

        print bmsg

        result = Do.popup(bmsg,1)
        print result
        if result is None:

The problem I have is after a random number of loops (between 1 and 29) Do.popup() returns True instead of None even though I haven't pressed OK.

Can you think what might be causing this?

(Windows 10 SikuliX 2.0.5)

Question information

English Edit question
SikuliX Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :

checked with this in your setup:

def mousePos():
    foo = "test %d: %s" % (n, atMouse())
    result = Do.popup(foo, 1)
    print result, foo
    return result

for n in range(50):
    if mousePos(): break

no problems, works as expected, even when moving the mouse around or even when clicking somewhere

Revision history for this message
Mike (maestro+++) said :

Tried it with the mouse stationery, constantly moving, clicking the mouse, pressing keys. It is running on two screens. I tried running it on both screens and moving the mouse to both screens.

With no obvious pattern, in all cases it switched to True after the the following number of loops:


The instance where it failed on the first call is particularly troubling.

((SikulixIDE-2.0.5 build# dev(2021-03-03_09:10) Windows 10 Home 19043.1151)

Revision history for this message
Mike (maestro+++) said :

My last comment was, for clarity, using your code.

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

again tested with 2 screens: works - no problems.

The only difference I can see:
You are running Win10-Home, I have Win10-Pro

So I am sorry, but I do not have any idea.

Revision history for this message
Mike (maestro+++) said :

Thanks for investigating.

Can you help with this problem?

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

To post a message you must log in.