← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #264823]: Implement Very Large Icons in "Add Picture" ?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
ok, understood ...
... but not agreed ;-)

--- I would really like that simple option
Not that simple as you might think.
Internally we use the standard Java Swing FileChooser to be system independent (one of the basic principles with SikuliX).
This feature down at the system level uses the the system specific file dialog. You might specify a file type filter and wether the dialog is for open or for save. 
I just looked into the Java docs: There is no option, that allows to specify HOW the file dialog should look like.

Since for version 2 the image management will be improved, I put on the
list to have an option for a group of images showing a thumbnail-like
representation.

--- will open the image loader
I understand the following about what you are doing:
- you have some "image-library" as a .sikuli container
- seems all to be IDE generated screenshots with timestamp (hence anonymous) names
- for some script you are editing, you want to copy some of these library images into the current script

If I am right, then in the first place this violates the DRY (don't repeat yourself) principle of software and data structure design.
The image files should not be copied (repeated), but referenced.
To make file referencing comfortable one needs a file name concept.
In the consequence your library image files should have speaking names and should be grouped somehow.

grouping by subfolder:

.../buttons
   ok.png
   cancel.png
   ...
.../menus
   open.png
   ...

grouping be name prefix

btnOk.png
btnCancel.png
menuOpen.png

This is supported in the IDE by setting the naming Preference to manually:
after having captured, you enter the name for the image

Since currently the first structure concept is not yet directly
supported, the first choice is the second concept.

In Python scripting based on import even another option is supported:
you capture with timestamp and assign a variable with a speaking name:
btnOk = "1234567890.png"

and say
from imageLib import * # imageless.sikuli is added to the image path automatically
click(btnOk)

this is sufficient for scripting, but lacks overview at the filesystem
level.

the general file naming and grouping concepts are supported by
addImagePath():

-- subfolders
addImagePath(<folder containing the image subfolders>)
click("buttons/ok.png")

- prefixed names
addImagePath(<folder containing the images>)
click(btnOk)

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