wild. (believe it or not, that’s not a word I use a lot… finding myself saying that a LOT in our interactions. hahahaha)
let me know if you experience any performance issues
one of the cool things about clojurizing a design is that, in my experience, using pure functions and values gives you design flexibility
roger that! oh, one last question… what is best way to get the dimensions of the window, to best calculate the sizes of left/right, height/width of the panes?
here's an example with 1000's of hoverable items. it uses an RTree rather than the default mouse-move handler, https://blog.phronemophobic.com/treemap/images/hover-keypath-shrunk.gif
someone else was requesting getting the window dimensions, https://github.com/phronmophobic/membrane/issues/2
(def window-size (atom [400 400]))
(defn -reshape [window window-handle width height]
(try
(let [[xscale yscale :as content-scale] (skia/get-window-content-scale-size window-handle)
width (/ width xscale)
height (/ height yscale)]
(reset! window-size [width height]))
(catch Exception e
(println e))
(finally
(skia/-reshape window window-handle width height))))
;; need to provide a `reshape` handler
(comment
;; run use the following
(let [[window-width window-height] @window-size]
(skia/run #(counter @window-size @counter-state)
{:handlers {:reshape -reshape}
:window-start-width window-width
:window-start-height window-height})))
HEY! I read that blog article in my RSS reader! I loved it! I had no idea you wrote it! So cool!!!
I think the above snippet is the relevant bit
the only part that would be different for you is instead of #(counter @window-size @counter-state)
, you would have something like #(memframe/re-frame-app (todo-app))
Hahaha. I remember reading that article, marveling at the UI, wondering how the author built it. And I was just about to ask you, as you talk about your design goals, I’d love to understand what in the world you’re writing that would cause you to rewrite your own UI framework, almost from scratch. So hilarious that both questions are now somewhat answered. Cool, I’ll give that a shot…. Maybe tonight. Gotta go feed kids. Thanks for all the hand holding. I’ll write an experience report, as well, to put in an issue and sample program.
thanks so much for plowing through all the rough edges!
the goal is to build something like http://worrydream.com/DrawingDynamicVisualizationsTalkAddendum/ , except instead of dynamic drawings, building actual dynamic user interfaces. Bret Victor doesn't talk about how to do event handling, so that's an area I've been working on.
Bret Victor! Amazing! I love that lecture he did in Portland five years ago — https://www.youtube.com/watch?v=agOdP2Bmieg. I haven’t watched that video in years, but I remember being blown away when I first watched it. I’lll watch in again tonight. After I get search and selection working in app. 🙂
@smith.adriane First time I’ve made an animated GIF — shows clicking to select, as well as using j/k to select. Next up: search! 🙂
(Just realized I cut the portion with the scrolling — I’ll post another one when I get search working. 🙂
very cool!
it's been a while since I've watched his series of talks. I'll have to go through them again
fyi, this is the script I've been using for making gifs from mov files:
f="demo1.mov"
ffmpeg -i "$f" -filter_complex "setpts=0.25*PTS,split=[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" `basename "$f" .mov`".gif"
the 0.25 in the script speeds up the video by 4xAwesome!
And I just got search/filtering working! I’ll post movie in just a second! Thanks for your help!
Holy cow, this is great! You can see the scrolling strangeness 15s in… filtering at 30s. So fun.. and just in case you can’t tell, I’m super happy that I could build something with utility! (link to 80MB movie in dropbox.). Thanks for all your great work and your help! https://www.dropbox.com/s/dz832r85jxtd90u/demo2.mov?dl=0
Have great night!
checking it out! have a great night!
Oh, another potentially far out request: Is it possible to copy/paste text from a scrollview?
like with text selection or just generally?
Umm, don’t know? Any way to select text, and then copy to clipboard would be great. (I now recall that I saw copy to clipboard as an event, but no way. to click/drag/select text.)
I haven't built a way to generically select text from labels
Roger that! (makes one not take all these native UI widgets for granted!!! 😂. Okay, catch you likely over the weekend. Much fun planned!!! 🙂
Have a great Friday night!
text selection and copy and paste work in text areas, but not in labels. if you're copying full snippets (like the titles), I've added little copy buttons that just paste to clipboard:
(defn copy-to-clipboard! [s]
(let [selection (StringSelection. s)
clipboard (.getSystemClipboard (Toolkit/getDefaultToolkit))]
(.setContents clipboard selection selection)))
(:import
java.awt.Toolkit
java.awt.datatransfer.StringSelection
java.awt.datatransfer.Clipboard)
Oh wait. What are the other ways to render text besides ui/label
? I might be using the wrong UI widget. (Umm, what is the right term for scrollarea, button, label?)
all the text rendering uses ui/label
but there are other views that render text (they use ui/label under the hood) like buttons
Thx! Roger that. Okay, have a great night! 🎉
have great night!