     (when-let [r (try (re-pattern (config t-f :text)) (catch Exception e nil))]
       (filter #(re-find r %) string-seq))))
 
+(defn ensure-selection-visible
+  "Scroll the selection of a listbox within view.
+  Input lbx is a swing listbox reference.
+  or input: root and keyword-id lbx-kw for the listbox."
+  ([lbx] (.ensureIndexIsVisible lbx (.getSelectedIndex lbx)))
+  ([root lbx-kw]
+    (let [id (partial select-id root)]
+      (.ensureIndexIsVisible (id lbx-kw) (.getSelectedIndex (id lbx-kw))))))
 
 (defn find-in-doc-strings
   [pat-in-str]

          :key  "menu R"
          :handler (fn [e]
            (auto-refresh-browser-handler {:root (to-root e)}))))


;; Init functions called during construction of a frame with its widget hierarchy

          vars-lb-popup (popup :id :vars-lb-popup)

          ]
          
      (seesaw.meta/put-meta! root :auto-refresh-browser-timer auto-refresh-browser-timer)
      
      (config! root :menubar main-menu)

