https://groups.google.com/d/forum/seesaw-cljseesaw-cljDiscussion of Seesaw UI toolkit for Clojure.
<br><a href="https://github.com/daveray/seesaw">https://github.com/daveray/seesaw</a>Google GroupsCecil Westerhof2016-07-19T13:49:26Zhttps://groups.google.com/d/topic/seesaw-clj/42gLDjon1gURe: Displaying a scaled down picture and drawing a rectangle on it2016-07-19 12:18 GMT+02:00 Cecil Westerhof <cldwes...@gmail.com>: > > At the moment I am using Image Magick on the command line with trial and > error to crop the right part of the photo. For example: > https://www.instagram.com/p/BH7r97NgvFX/ > > But this is a ‘bit’ of work. So I was thinkingCecil Westerhof2016-07-19T10:18:57Zhttps://groups.google.com/d/topic/seesaw-clj/42gLDjon1gUDisplaying a scaled down picture and drawing a rectangle on itAt the moment I am using Image Magick on the command line with trial and error to crop the right part of the photo. For example: https://www.instagram.com/p/BH7r97NgvFX/ But this is a ‘bit’ of work. So I was thinking about writing a Clojure program to do the cropping for me. That would saveJames Elliott2016-07-18T05:07:04Zhttps://groups.google.com/d/topic/seesaw-clj/KCWZFtIfReYConfusing doc stringI can't tell from reading this if id-of returns a string or a keyword. The first paragraph says string, the second says keyword. I am going to have to try it and see, but it would be nice to be spared that step in the future. :) seesaw.core/id-of [w] Returns the id of the given widget if theJames Elliott2016-07-18T04:59:00Zhttps://groups.google.com/d/topic/seesaw-clj/1ubN0gICiBQNeed to rebuild documentation pages?I was tripped up when trying to follow the example for a button-group listener, because the documentation at http://daveray.github.io/seesaw/seesaw.core-api.html#seesaw.core/button-group had the following: (listen bg :selection (fn [e] (if-let [s (selection e)] (printlndaveray2016-07-12T16:08:04Zhttps://groups.google.com/d/topic/seesaw-clj/wRZfLDwshysRe: where to see config! optionsTry running seesaw.dev/show-options  on a widget to find out (mostly) what options are available. Hope that helps, Dave  https://github.com/daveray/seesaw/blob/develop/src/seesaw/dev.clj#L95 On Mon, Jul 11, 2016 at 8:11 PM, 胡傲果 <hua...@gmail.com> wrote: > I know config! colud be used to胡傲果2016-07-12T03:11:15Zhttps://groups.google.com/d/topic/seesaw-clj/wRZfLDwshyswhere to see config! optionsI know config! colud be used to set :text :background :size, is there a doc for these options? If I want to find a option to be config, where do I go to find it.daveray2016-05-26T04:20:13Zhttps://groups.google.com/d/topic/seesaw-clj/lsz8QC1rH4MRe: How can I make a button that shows a popup menu when you click in it?I'm glad it worked :) re: "Java Swing". You just blew my mind. That's crazy. Dave On Wed, May 25, 2016 at 11:49 AM, James Elliott <ja...@brunchboy.com> wrote: > Brilliant, that was precisely the direction I needed. Here is the simple > function I ended up with: > > (defn- show-popup-from-buttonJames Elliott2016-05-25T18:49:51Zhttps://groups.google.com/d/topic/seesaw-clj/lsz8QC1rH4MRe: How can I make a button that shows a popup menu when you click in it?Brilliant, that was precisely the direction I needed. Here is the simple function I ended up with: (defn- show-popup-from-button "Displays the popup menu when the gear button is clicked as an ordinary mouse event." [target popup event] (.show popup target (.x (.getPoint event)) (.ydaveray2016-05-25T17:09:41Zhttps://groups.google.com/d/topic/seesaw-clj/lsz8QC1rH4MRe: How can I make a button that shows a popup menu when you click in it?oh, and it's awesome you're finding it so useful! :) On Wed, May 25, 2016 at 10:09 AM, Dave Ray <dav...@gmail.com> wrote: > Gotcha. In that case, you probably want to use a modified version of the > popup handler: > > https://github.com/daveray/seesaw/blob/develop/src/seesaw/core.clj#L2360 > > Indaveray2016-05-25T17:09:12Zhttps://groups.google.com/d/topic/seesaw-clj/lsz8QC1rH4MRe: How can I make a button that shows a popup menu when you click in it?Gotcha. In that case, you probably want to use a modified version of the popup handler: https://github.com/daveray/seesaw/blob/develop/src/seesaw/core.clj#L2360 In your case, I think you'd listen for a mouse event, but just change the `isPopupTrigger` handling to whatever you want to trigger on.James Elliott2016-05-25T16:41:26Zhttps://groups.google.com/d/topic/seesaw-clj/lsz8QC1rH4MRe: How can I make a button that shows a popup menu when you click in it?And, by the way, thanks for this fantastically productive framework that let me throw together a system in about a week that was already used to synchronize visuals with music at the Electric Elements music festival this past weekend: https://github.com/brunchboy/beat-link-trigger#beat-link-trigJames Elliott2016-05-25T16:36:36Zhttps://groups.google.com/d/topic/seesaw-clj/lsz8QC1rH4MRe: How can I make a button that shows a popup menu when you click in it?Thanks, Dave, I took a look at that example, and I can’t understand how I would extend it to do what I want. In the example, all of the popups are being triggered by the normal platform context-menu event, so they can take advantage of seesaw’s great :popup feature. I am already using that todaveray2016-05-25T16:31:21Zhttps://groups.google.com/d/topic/seesaw-clj/lsz8QC1rH4MRe: How can I make a button that shows a popup menu when you click in it?I think the popup example is probably a good starting point for what you want to do: https://github.com/daveray/seesaw/blob/develop/test/seesaw/test/examples/popup.clj Dave On Tue, May 24, 2016 at 3:59 PM, James Elliott <ja...@brunchboy.com> wrote: > I have contextual-menu style popups workingJames Elliott2016-05-24T22:59:24Zhttps://groups.google.com/d/topic/seesaw-clj/lsz8QC1rH4MHow can I make a button that shows a popup menu when you click in it?I have contextual-menu style popups working fine, but I would like to give new users a visual indicator that the contextual menu exists by having a button with a gear on it which, when clicked without modifier keys, brings up the same set of choices. But I am having trouble figuring out how toJames Elliott2016-05-20T16:46:56Zhttps://groups.google.com/d/topic/seesaw-clj/m5AbNxXLqXQRe: Using value with repeating structuresNobody has said anything, so I went ahead and tried creating multiple panels with components inside them whose IDs are unique within the panel, but not the entire frame. This seems to work exactly as I need it to: I can select things fine at the panel level, and get and set the value of eachJames Elliott2016-05-18T17:20:30Zhttps://groups.google.com/d/topic/seesaw-clj/m5AbNxXLqXQUsing value with repeating structuresHello, everyone, I just started using seesaw this past week in order to put together a user interface that will be helping coordinate visuals for a DJ at a music festival this weekend, and it has been delightful. The current state of my code can be found at https://github.com/brunchboy/beat-linkdaveray2016-05-16T19:55:15Zhttps://groups.google.com/d/topic/seesaw-clj/C-8nJV0h-dcRe: Widgets inside a canvas?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 On Mon, May 16, 2016 at 11:55 AM, Andrew Dabrowski <unhan...@gmail.com> wrote: > Thanks, that solves my problem, I somehow missed xyz-panel in the api docs. >Andrew Dabrowski2016-05-16T18:55:32Zhttps://groups.google.com/d/topic/seesaw-clj/C-8nJV0h-dcRe: Widgets inside a canvas?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? On Monday, May 16, 2016 at 10:06:33 AM UTC-4, daveray wrote: > > Hey, > > xyz-panel supports laying out widgets on top of somethingdaveray2016-05-16T14:06:33Zhttps://groups.google.com/d/topic/seesaw-clj/C-8nJV0h-dcRe: Widgets inside a canvas?Hey, xyz-panel supports laying out widgets on top of something paintable. Here's an example: https://github.com/daveray/seesaw/blob/develop/test/seesaw/test/examples/xyz_panel.clj Dave On Sun, May 15, 2016 at 2:22 PM, Andrew Dabrowski <unhan...@gmail.com> wrote: > Is it possible to placeAndrew Dabrowski2016-05-15T21:22:44Zhttps://groups.google.com/d/topic/seesaw-clj/C-8nJV0h-dcWidgets inside a canvas?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 theAndreas Olsson2016-03-22T06:21:59Zhttps://groups.google.com/d/topic/seesaw-clj/zO6TtYJet7gRe: Load image(maby a jpg) to a image-buffer.Thank you, I´m not coming from java so it´s hard sometimes.:-) I think Seesaw is great but the Seesaw API docs needs an update. Need help with that? Den måndag 21 mars 2016 kl. 23:57:49 UTC+1 skrev daveray: > > Something like this should work if I understand what you're going for: > > (def picdaveray2016-03-21T22:57:49Zhttps://groups.google.com/d/topic/seesaw-clj/zO6TtYJet7gRe: Load image(maby a jpg) to a image-buffer.Something like this should work if I understand what you're going for: (def pic (javax.imageio.ImageIO/read (java.io.File. "/path/to/file.jpg"))) See https://docs.oracle.com/javase/7/docs/api/javax/imageio/ImageIO.html#read%28java.io.File%29 Dave On Mon, Mar 21, 2016 at 1:35 PM, Andreas OlssonAndreas Olsson2016-03-21T20:35:08Zhttps://groups.google.com/d/topic/seesaw-clj/zO6TtYJet7gLoad image(maby a jpg) to a image-buffer.Trying to import an image to a image-buffer but having trouble solving it. heres a try: (def pic (seesaw.graphics/buffered-image 200 200)) (def dopic (.imageio.ImageIO.read pic (str (System/getProperty "user.dir") "\\resources\\grumpy.jpg"))) Am I totaly of??Andreas Olsson2016-03-21T10:07:18Zhttps://groups.google.com/d/topic/seesaw-clj/StMwNrk3eZERe: image-buffer problem... .setStroke??Solved :-) Den måndag 21 mars 2016 kl. 10:58:08 UTC+1 skrev Andreas Olsson: > > Trying out the buffered-image, but I cant get line 17 right. > How do i use it? > > http://pastebin.com/QF7LnwMd >Andreas Olsson2016-03-21T09:58:08Zhttps://groups.google.com/d/topic/seesaw-clj/StMwNrk3eZEimage-buffer problem... .setStroke??Trying out the buffered-image, but I cant get line 17 right. How do i use it? http://pastebin.com/QF7LnwMdStefan Kamphausen2016-01-25T09:03:20Zhttps://groups.google.com/d/topic/seesaw-clj/OqmAG8Gou0cRe: Button event-handlerOn my Linux box this just works for all 5(!) buttons I can find on my mouse. I tried it in a leiningen REPL in a project using Seesaw. If it does not work for you, you may have another operating system or other problems. I'd say that it is not related to Java, Swing or Seesaw here. Regard,Stefan Kamphausen2016-01-25T09:00:18Zhttps://groups.google.com/d/topic/seesaw-clj/l6kTbSzF5tcRe: No printing in the REPLHi, On Wednesday, January 20, 2016 at 12:30:15 PM UTC+1, Amir Teymuri wrote: > > In the tutorial there is the chapter on the listbox, i have tried to print > out the selections, but it doesn't work for me. > it definitely works in a vanilla REPL that you can start for example with "lein repl".Amir Teymuri2016-01-23T10:39:12Zhttps://groups.google.com/d/topic/seesaw-clj/TLsj38nCQSsUnderstanding (show-options) and (show-events)Often when i call the (show-options) of a function it prints mostly the very same options as for other functions. For example calling (show-options (border-panel)) and (show-options (label)) and (show-options (toolbar)) all include a :text options, from which only (label) supports :text, fromabacus2016-01-21T00:44:41Zhttps://groups.google.com/d/topic/seesaw-clj/l6kTbSzF5tcRe: No printing in the REPLYou can write messages to a file. One way to do that is with tools.logging (https://github.com/clojure/tools.logging). Another thing you can do is def an atom holding a vector for messages, and "swap!" conj new messages into it. Meanwhile, at the REPL you can inspect what's in the atom.Amir Teymuri2016-01-20T11:30:15Zhttps://groups.google.com/d/topic/seesaw-clj/l6kTbSzF5tcNo printing in the REPLIn the tutorial there is the chapter on the listbox, i have tried to print out the selections, but it doesn't work for me. Maybe someone could point it out what am i doing wrong and why i don't get anything printed out in the REPL? (def f (frame :title "sandiego")) (def lb (listbox :model [:dAmir Teymuri2016-01-19T23:12:13Zhttps://groups.google.com/d/topic/seesaw-clj/OqmAG8Gou0cButton event-handlerAdding an event-handler to a button the actions are divided between right and left buttons of the mouse. I was doing something like this: (def f (frame :title "san-diego")) (def btn (button :text "btn" :font "monospaced-bold-40")) (listen btn :mouse-pressed #(config! % :foreground :orange)daveray2016-01-19T17:29:47Zhttps://groups.google.com/d/topic/seesaw-clj/WFi4OzAYTugRe: Invoking :font option on (flow-panel)since panels don't display text, they don't have a :font option. Try setting :font on the result of your (text ...) call. Dave On Tue, Jan 19, 2016 at 1:17 AM, Amir Teymuri <amirt...@gmx.de> wrote: > According to (show-options (flow-panel)) (flow-panel) does support the > :font option. How isAmir Teymuri2016-01-19T09:17:06Zhttps://groups.google.com/d/topic/seesaw-clj/WFi4OzAYTugInvoking :font option on (flow-panel)According to (show-options (flow-panel)) (flow-panel) does support the :font option. How is :font to invoke on flow-panel? This does not work: (config! my-frame :content (flow-panel :items ["FILE:" (text "here comes the TEXT")] :font "ARIAL-BOLD-100" :background :red))Stefan Kamphausen2016-01-18T14:53:28Zhttps://groups.google.com/d/topic/seesaw-clj/hslPZnYYB9oRe: Running seesaw and overtone libraries togethearHi, On Sunday, January 17, 2016 at 3:31:56 AM UTC+1, Amir Teymuri wrote: > > Obviously (require) can't do the work, i do (require 'seesaw.core > 'overtone.core 'clojure.repl), but at the next line the (native!) function > can't get resolved. > you might want to get a little more familiar withAmir Teymuri2016-01-17T02:31:56Zhttps://groups.google.com/d/topic/seesaw-clj/hslPZnYYB9oRe: Running seesaw and overtone libraries togethearObviously (require) can't do the work, i do (require 'seesaw.core 'overtone.core 'clojure.repl), but at the next line the (native!) function can't get resolved. Am Sonntag, 17. Januar 2016 01:27:18 UTC+1 schrieb abacus: > > I do not know about Overtone specifically, but in general you can >abacus2016-01-17T00:27:18Zhttps://groups.google.com/d/topic/seesaw-clj/hslPZnYYB9oRe: Running seesaw and overtone libraries togethearI do not know about Overtone specifically, but in general you can introduce the seesaw.core and other namespaces with "require" instead of "use", and their symbols won't conflict. See http://clojure.org/reference/namespaces or a more in-depth explanation at https://blog.8thlight.com/colin-jonesAmir Teymuri2016-01-16T14:27:15Zhttps://groups.google.com/d/topic/seesaw-clj/hslPZnYYB9oRunning seesaw and overtone libraries togethearHello, i want to use the overtone and seesaw namespaces in one project. However when i load them there seems to be a function named (select) which exists in both seesaw.core and overtone.core ((seesaw.core/select) (overtone.core/select)), why i can't load both of the libraries in the project.DB Conrado2015-12-13T16:42:17Zhttps://groups.google.com/d/topic/seesaw-clj/wZaDrRbC_SwBeginning by doing some exercises from Deitel's bookSup guys! I'm new to the community and also to the Clojure language itself. So, I began my learning by doing some exercises from Deitel's Java How to Program book, 6th ed. You can see what I've done at: https://github.com/dbconrado/deitel-clojure-exercises Hope it helps other beginners like medaveray2015-11-30T04:12:10Zhttps://groups.google.com/d/topic/seesaw-clj/ES4kHuQm7AMRe: setting gradient background color on buttonThe :background property just passes through to setBackground  which only supports Color objects as arguments. The only approach I know of is to override painting of the button. See the docstring for seesaw.core/canvas. For a button it would be something like: (do (def my-button (button))daveray2015-11-30T04:03:13Zhttps://groups.google.com/d/topic/seesaw-clj/l1CshjMqD9YRe: again (please help!): center-align vertical labelsHey, Sorry about the slow response. Holidays and stuff. Unfortunately, I don't think you'll get the effect you're going for with a vertical panel. This is because the labels themselves don't expand to fill the horizontal space of the panel so changing the alignment of their text doesn't reallyjun...@selma.hfmdk-frankfurt.de2015-11-29T18:25:07Zhttps://groups.google.com/d/topic/seesaw-clj/ES4kHuQm7AMsetting gradient background color on buttonI'm trying to change the background color for a button. Since the default theme uses gradients I'd like to paint it with gradients, too. Unfortuately the following gives an error: This works: (do (def my-button (button)) (config! my-button :background :red)) This doesn't work: (dojun...@selma.hfmdk-frankfurt.de2015-11-29T14:25:12Zhttps://groups.google.com/d/topic/seesaw-clj/l1CshjMqD9Yagain (please help!): center-align vertical labelsHi, I'm still not getting anywhere trying to center-align labels in a vertical panel. This is what I have tried: (let [f (frame :content (vertical-panel :items [(label :text "One" :halign :left) (label :text "Four" :halign :center)jun...@selma.hfmdk-frankfurt.de2015-11-23T09:45:55Zhttps://groups.google.com/d/topic/seesaw-clj/oS04BMfKROEcenter-align widgets in vertical-panelHi, I try to get a slider and a label above and below to center-align. I tried the following without success: (-> (frame :title "aligntest" :content (vertical-panel :items [(label :id "lbl01" :text "0" :halign :centerdaveray2015-11-23T04:55:53Zhttps://groups.google.com/d/topic/seesaw-clj/XWeXejyeOjkRe: JLayeredPane and JScrollBar?As Gary mentions, a lot of Seesaw will work on normal Swing objects, even those it doesn't know about. Otherwise, adding direct support isn't too complicated. I think listbox is a reasonable example: https://github.com/daveray/seesaw/blob/develop/src/seesaw/core.clj#L1681 Hope this helps, DaveGary Verhaegen2015-11-22T21:53:07Zhttps://groups.google.com/d/topic/seesaw-clj/XWeXejyeOjkRe: JLayeredPane and JScrollBar?IIRC, seesaw is mostly a set of sane, nice functions that create and manipulate Swing objects, so most of your function results and arguments are actually unwrapped Swing objects, meaning that if seesaw does not offer a nice factory function for some class, you should be able to just call thejun...@selma.hfmdk-frankfurt.de2015-11-22T18:33:52Zhttps://groups.google.com/d/topic/seesaw-clj/XWeXejyeOjkJLayeredPane and JScrollBar?Hi, is there support for JLayeredPane and JScrollBar in seesaw, or, if not, how would I add it?jun...@selma.hfmdk-frankfurt.de2015-11-22T16:01:00Zhttps://groups.google.com/d/topic/seesaw-clj/sE0I2HPxv64Re: howto run a custom function when frame gets closedOk, found a solution: (def f (ss/frame :listen [:window-closing (fn [_] (println "closed!"))])) Am Sonntag, 22. November 2015 16:16:40 UTC+1 schrieb jun...@selma.hfmdk-frankfurt.de: > > Hi, > > is there a way to run a function when closing a frame in order to do some > cleanup? >jun...@selma.hfmdk-frankfurt.de2015-11-22T15:16:40Zhttps://groups.google.com/d/topic/seesaw-clj/sE0I2HPxv64howto run a custom function when frame gets closedHi, is there a way to run a function when closing a frame in order to do some cleanup?dark-h2015-11-05T23:52:11Zhttps://groups.google.com/d/topic/seesaw-clj/r-ffq3eyvwwhaving trouble with seesaw drag and drop (dnd)Hi All, I am a clojure newbee so please bare with me: I am trying to develop a simple gui using seesaw whereby I want to drag and drop swing components (JButtons) from one container to another. But for some reason I can't make it work. I am pretty sure there is something fundamentally wrong butLAWRENCE2015-09-09T00:42:55Zhttps://groups.google.com/d/topic/seesaw-clj/3MvvcRmzYCIRe: problem with .contains in Rectangle2D - seesaw.graphics rectFound my logic problem - revised edition: (defn cont [x y rectangles] (loop [x1 x y1 y r rectangles] (when (not (empty? r)) (if (= (.contains (first r) x y)) (print-xy x y) (recur x y (rest r))) ))) (defn print-xy [x y] (println " x " x " y " y) ) On Tuesday, September 8,