I have a nine textboxes nested inside of vertical panels that I want grab the text from and use. For convenience, I'm just using select
to grab them by class, then applying them to the constructor of a record. Basically something like:
(ns example.core
(:require [seesaw.core :as sc]))
(apply ->RecordConstructor
(sc/select root [:.textbox]))
This seems to work as I expect, but I haven't been able to find anything official on what defines the order that select
returns its elements in.
It seems to be based on the order that the elements were given to their parent. Is this correct?
I'm no expert, but it looks like seesaw just does a depth-first tree walk of its document model. So there's nothing guaranteed, but sure, it sounds like you will get things in that order: depth-first, leftmost-first. Here "left" is whatever order seesaw stores its stuff in, not necessarily display order. Again I don't know what order that is, but your guess of "the order you added stuff to the model" seems as good as any to me.