!7 static DynamicVStack buttons; p-subst-autoupdate { buttons = showNiceVerticalButtons(); refresh(); addButtonsToWindow(buttons, "Refresh", f-thread refresh); } svoid refresh { if (replaceNiceButtons(buttons, filesForNiceButtons(sortFilesByDate(listPNGFiles(userDesktopDir()))))) { centerPackFrame(buttons); final JScrollPane sp = getParentOfType(buttons, JScrollPane.class); scrollPaneOnScroll(sp, r { //print("Scroll. " + mapMethod('getBounds, buttons.components())); JViewport vp = sp.getViewport(); Rect vpRect = toRect(vp.getBounds()); new L l; for (Component c : buttons.components()) { Rect r = boundsInParent(c, vp); if (rectsIntersect(vpRect, r)) l.add(getText((JButton) c)); } print("Showing: " + l); }); } }