sclass G22SnPSelector > MetaWithChangeListeners is Swingable { settable new SnPSettings settings; // show powers of two in pixelRows selector or all numbers? settableWithVar bool powerOfTwoPixelRows; settable int maxPixelRows = 512; SnPSettings get() { ret settings; } cachedVisualize { var colors = jspinner(settings.colors, 2, 256); main onChange(colors, -> { settings.colors = intFromSpinner(colors); change(); }); var pixelRows = jListSpinner(pixelRowsList(), settings.pixelRows); main onChange(pixelRows, -> { settings.pixelRows = intFromSpinner(pixelRows); change(); }); varPowerOfTwoPixelRows().onChange(-> spinnerSetNumberList(pixelRows, pixelRowsList()); componentPopupMenuItem(pixelRows, jLiveValueCheckBoxMenuItem("Powers of two only", varPowerOfTwoPixelRows())); ret hstack( colors, jlabel(" colors @ "), pixelRows, jlabel(" p")); } L pixelRowsList() { ret powerOfTwoPixelRows ? powersOfTwoUpTo(maxPixelRows) : virtualCountList_incl(1, maxPixelRows); } }