[1.1.0]JRuby scripting: popSelect does not work

Asked by masuo

I setuped SikuliXIDE 1.1.0(2015-01-16_01:00nightly).
Then I chose Ruby as scripting language.
OS:Windows7(32bit)

I am interested in a new function select().
I wrote the following sentence.

sample.rb
  items = ["model-a","model-b","model-c"]
  selected = select("model:","Select model",items)

When I run this script, TypeError was occured.
[error] (TypeError) wrong argument type String (expected Array)

Could you tell me where the cause is?

Question information

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

-- !. sorry for the docs bug: it is named popSelect (not select) (will fix it)

-- 2. even if you used popSelect correctly in JRuby scripting context, it would not work, do to a bug in the Sikulix JRuby wrapper, which will be fixed in the next nightly.

-- 3. the correct usage in JRuby context currently would be:
items = ["model-a","model-b","model-c"].to_java :string
selected = popSelect("model:","Select model",items)

... but hopefully the next nightly build will also allow to use:
items = ["model-a","model-b","model-c"]
selected = popSelect("model:","Select model",items)

... since the wrapper can do this modification.

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

BTW: with Jython scripting popSelect works as expected.

Revision history for this message
masuo (masuo-ohara) said :
#3

Thanks RaiMan, that solved my question.