I need some things that are almost the same. I solved that in this way: (def search-fields [ ["Search Quotes (Case Independent)" #(show-search-quotes %)] ["Search Quotes Not (Case Independent)" #(show-search-quotes-not %)] ["Search Quotes Word Bounderies" #(show-search-quotes-word-boundary %)] ["Search Quotes Begin (Case Independent)" #(show-search-quotes-begin %)] ["Search Quotes End (Case Independent)" #(show-search-quotes-end %)] ["Search Quotes Java Regular Expression" #(show-search-quotes-java-regex %)] ["Search Quotes Java Regular Expression Not" #(show-search-quotes-java-regex %)] ])
(dotimes [i (count search-fields)] (let [ description (nth (nth search-fields i) 0) function (nth (nth search-fields i) 1) ] (grid-bag-layout search-panel :fill GridBagConstraints/HORIZONTAL :ipadx 8 :ipady 4 :gridy i :gridx 0 ^JLabel (label description) :gridx 1 ^JTextField (text :columns 40 :listen [:action (fn [e] (let [ search-str (text e) ] (when (not (empty? search-str)) (function search-str)))) ])))) Is that the correct way, or can it be done better? -- Cecil Westerhof -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.