Call corresponding picturesHi all, This might be trivial but I could't find anything on the index.
I created a drop down list of length of product of 100, 200, 300 .....
For each length, I want to display a corresponding picture of the product. I have put all pictures in a folder and name them.
Is there any function in jsl that enables this?
Thank you!
Automation and ScriptingContent OrganizationData AccessData Blending and CleanupWindowsRe: Call corresponding pictures// there are a lot of pics here, pick 6 for the list
files = Files In Directory( "f:/pics" )[10 :: 15];
New Window( "Example",
H List Box(
cb = Combo Box(
files,
selection = cb << GetSelected();
img = New Image( "f:/pics/" || selection );
(bb << child) << delete;// clear the old one
bb << append( img ); // add the new one
),
bb = Border Box( Text Box() ) // start with a dummy old one
)
);
Remove the [10::15] to get all of the images. You may want to use FilterEach(...) to keep only the .JPG or .PNG files. This example assumes the image name is appropriate for the combo box display. If you need a different word, you could use the <
The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.The picture changes with each combo box selection.
Re: Call corresponding picturesHI Craige, Thank you for you reply! it is exactly what I need. But I encountered a error when applying the code. I put my images in a folder, got the directory and replaced "f:/pics/". The drop down box was generated and is displayed, but no picture was shown. When I chose a picture in the drop down box, an erorr poped up and said "
file not found in access or evaluation of 'New Image' " Do you know what's the problem?
Re: Call corresponding picturesmissing / when the path and filename are joined.