Widgets inside a canvas?

68 views
Skip to first unread message

Andrew Dabrowski

unread,
May 15, 2016, 5:22:44 PM5/15/16
to seesaw-clj
Is it possible to place widgets at arbitrary positions inside a canvas? Apparently that can be done in Java, but I haven't come across any examples in seesaw. I tried a paint function like
(fn [c g]
(.add c button '(x y))
and although it didn't produce an error, it also didn't display the button.

I can't find anything about this in the seesaw.graphics api (not surprising perhaps since it's out of date). Could someone give me a pointer?

Dave Ray

unread,
May 16, 2016, 10:06:33 AM5/16/16
to seesa...@googlegroups.com
Hey,

xyz-panel supports laying out widgets on top of something paintable. Here's an example:


Dave



--
You received this message because you are subscribed to the Google Groups "seesaw-clj" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seesaw-clj+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Dabrowski

unread,
May 16, 2016, 2:55:32 PM5/16/16
to seesaw-clj
Thanks, that solves my problem, I somehow missed xyz-panel in the api docs.

Just for future reference, there is in fact no easy way to add widgets to a canvas?

Dave Ray

unread,
May 16, 2016, 3:55:15 PM5/16/16
to seesa...@googlegroups.com
Not without dropping down to swing I think. You could take a look at the xyz-panel impl so see whether it's actually easy or not :)

Dave
Reply all
Reply to author
Forward
0 new messages