Icon representing a recipe

Recipe: SelectBands

created by LociOiling

Profile


Name
SelectBands
ID
104235
Shared with
Public
Parent
None
Children
None
Created on
December 19, 2020 at 20:58 PM UTC
Updated on
December 19, 2020 at 20:58 PM UTC
Description

Demonstrate dialog.SelectBands

Best for


Code


bands = dialog.SelectBands () print ( #bands .. " bands selected" ) bndlst = "" for ii = 1, #bands do bndlst = bndlst .. bands [ ii ] if ii < #bands then bndlst = bndlst .. "," end end print ( "bands = \"" .. bndlst .. "\"" )

Comments


LociOiling Lv 1

This recipe demonstrates dialog.SelectBands, a new call which replaces the "user pick" option found in GUI recipes.

As with dialog.SelectSegments, SelectBands has some confusing highlighting.

The first band selected is not highlighted initially.

When a second band is selected, the highlighting depends on whether the band index is greater than or lesser than the band index of the first band selected.

When the index of the second band is lower, the second band is highlighted.

When the index of the second band is higher, the first band selected is highlighted. Clicking the same second band again clears the highlighting of the first band.

As with SelectSegments, the correct bands seem to be selected by SelectBands, but the visual presentation is confusing.

With SelectBands, the bands selected can be seen (when highlighted) regardless of the coloring option selected, which is not the case with SelectSegments.