← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #162885]: [HowTo] use functions with parameters

 

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

RaiMan posted a new comment:
I hate, that you cannot edit at least your own comments :-((


--- sample usage:

myReg = some_application_window # has to be a valid region

g = GuiElements() # get instance
g.setRegion() = myReg # restrict the searches
g["Button1"] = ["image-of-button1.png", "Sorry, Button1 currently not visible!"] # register a button

# click a registered element
if not g.clickElement("Button1"): exit(1)
print "we clicked Button1", g.getRegion().getLastMatch()

# click a not registered element
img = "some-other-button.png"
if not g.clickElement(img): exit(1)
print "we clicked", img, g.getRegion().getLastMatch()

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