It looks like you may also be thinking that you are creating local bindings
in the 'add' call, but you actually need to create those bindings in a let.
 Also,'app' is bound to 'this' but never used.

I think something like this may be closer to what you are trying to do:

(defn -init [this]
  (let [tree (Tree. "Menu")
        vsplit (doto (VerticalSplitPanel.)
                 (.add (Label. "upper panel"))
                 (.add (Button. "lower panel")))
        hsplit (doto (HorizontalSplitPanel.)
                 (.setFirstComponent tree)
                 (.setSecondComponent vsplit))
        panel (doto (Panel. "Split panels inside this panel")
                (.setContent hsplit))
        window (Window. "Test application")]
    (do
      (.add window panel)
      (.setMainWindow this window))))



On Thu, Jun 23, 2011 at 2:27 PM, Ambrose Bonnaire-Sergeant <
abonnaireserge...@gmail.com> wrote:

> Does Window's add() method take multiple arguments? It looks like
> you're passing 4 arguments to it.
>
> Also           (tree Tree. "Menu")
> should be (tree (Tree. "Menu"))
>
> Same with (vsplit VerticalSplitPanel.
>
>                   (add (Label. "upper panel") (Button. "lower
> panel"))))))))
>
> Could you post the full source? Looks like you're using some helper
> functions like "tree"
> and "vsplit" and "panel".
>
> Ambrose
>
> On Fri, Jun 24, 2011 at 2:19 AM, Antonio Recio <amdx6...@gmail.com> wrote:
>
>> There are not window in the java code, anyway I have added it in the
>> clojure code (could be deleted).
>>
>> The window java code could be something like this:
>> setMainWindow(new Window("Test application"));
>>
>> --
>> 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 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 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

Reply via email to