Is possible to make a combo box to pick an option instead of type it?

Asked by Ezequiel

I want to have a predefined option list to enter parameters into my sikuli script.
Is that possible??

Thanks!!

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

If you are familiar with Java, then have a look at the appropriate javax.swing features, that can be used in Sikuli scripts (like JOptionPane, JComboBox). Not really recommended, if you never made this before.

--- poor man's solution (quick and dirty template):

options = ("1. option1", "2. option2", "X.optionsX")
optionDefault = 2

text=""
for o in options:
    text = text + o + "\n"
text = text + "\nSelect an option by entering it's number"
text = text + "\nJust click OK, to select the default"+options[optionDefault-1]
selected = input(text)

Revision history for this message
Ezequiel (pollakezequiel) said :
#2

Thanks RaiMan, that solved my question.