← Back to team overview

sikuli-driver team mailing list archive

[Question #245030]: Screen(1) doesn't seem to work.

 

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

Hey, I'm pretty new to Sikuli but am struggling with this multiple monitor thing.  I've looked through other posts and didn't quite find an answer.  I'm running Windows 7 (maybe that's the problem!) and have a laptop with an external monitor.  My external monitor is my primary desktop with the Start bar at the bottom and my laptop sits to the left.  When I run the code below, it tells me that I have 2 monitors, but I can't get it to select a region over on my laptop screen.  And in the line "scr=Screen(0)" the word Screen is red which tells me that it doesn't recognize that class name or something (I'm using the IDE by the way).  I've also tried Screen(1) and Screen(2) with no change.  It allows me to select a region on my primary external monitor but never on my laptop screen:

def changed(event):
        #popup("something changed ")
        for ch in event.changes:
                ch.highlight() # highlight all changes
        sleep(1)
        for ch in event.changes:
                ch.highlight() # turn off the highlights
ns = getNumberScreens()
popup("Number of screens = " + str(ns))
scr=Screen(0)
r = scr.selectRegion("Please select the region")
    # any change in r larger than 50 pixels would trigger the changed function
r.onChange(50, changed)
r.observe(5, background=False)

r.stopObserver()
popup("Done looking")


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