Re: JTable howto

2009-02-12 Thread what-a-guy
(fn [] 5) ; row-count-proc (fn [r c] (if (= c 0) "OK" true)))] ; get-value-at-proc (doto frame (.setContentPane tbl) .pack .show) On Feb 11, 4:33 pm, Meikel Bra

JTable howto

2009-02-11 Thread what-a-guy
How would I code the following in clojure? JTable table = new JTable(new MyTableModel()) { ... //Implement table header tool tips. protected JTableHeader createDefaultTableHeader() { return new JTableHeader(columnModel) { public String getToolTipText(MouseEvent e)

variable scope in an event handler

2008-12-27 Thread what-a-guy
Here's some code that works as I expected: dyn.clj (println *value*) test.clj (def *value* 'ok) (defn test-eval [] (load-file "dyn.clj")) (test-eval) => 'ok But when run in an event handler it fails: test.clj (import '(javax.swing JButton JFrame) '(java.aw

macro help

2008-12-26 Thread what-a-guy
I'm attempting what should be a simple transformation using a macro called dlg in the following code: (defn fld [parent lay id text field] '...) ;; dlg macro. For this input: ;; ;; (dlg "test" ;; (field fld-1 "Field number one" (JTextField.)) ;; (field fld-2 "Field number two" (JTextField.))

macro help

2008-12-26 Thread what-a-guy
I'm attempting what should be a simple macro transformation (dlg below): (defn fld [parent lay id text field] '...) ;; dlg macro. For this input: ;; ;; (dlg "test" ;; (field fld-1 "Field number one" (JTextField.)) ;; (field fld-2 "Field number two" (JTextField.))) ;; ;; we want this output:

macro help

2008-12-26 Thread what-a-guy
I'm getting stuck on what should be a simple macro (dlg below). It produces 2 different symbols (for 'parent#) when I was expecting both to refer to the same symbol. Here's the code: (defn fld [parent lay id text field] '...) ;; dlg macro. For this input: ;; ;; (dlg "test" ;; (field fld-1

macro help

2008-12-26 Thread what-a-guy
I'm attempting what should be a simple transformation using a macro called dlg in the following code: (defn fld [parent lay id text field] '...) ;; dlg macro. For this input: ;; ;; (dlg "test" ;; (field fld-1 "Field number one" (JTextField.)) ;; (field fld-2 "Field number two" (JTextField.))