Fork me on GitHub
#membrane
<
2020-08-26
>
genekim04:08:04

@smith.adriane It works! I’ll write up some notes on usage documentation as I go… This is so great! Thank you!

genekim04:08:12

@smith.adriane Is there an example of how to use the basic-components/scrollview widget? I tried using the test-scrollview to see if I could figure it out, and I’m getting these errors…

Aug 25, 2020 9:26:33 PM clojure.tools.logging$eval18234$fn__18237 invoke
SEVERE: re-frame: no :event handler registered for: :update
(What I’m really trying to do: I want to put potentially hundreds of lines of text into a scrollable area, without having to create any handlers. Or maybe a textarea? [trying that next…])

phronmophobic04:08:58

all the stuff in membrane.basic-components is meant to work with an alternate state management framework, membrane.component . so if you're using re-frame, you would have to handle the state yourself

genekim04:08:55

Is there anything equivalent to an HTML textbox, where the scrollbars are managed for you?

phronmophobic04:08:57

membrane.component and re-frame both fulfill the same responsibilities

phronmophobic04:08:37

not currently 😞

genekim04:08:12

Got it! Super helpful to know! Thank you, @smith.adriane!

genekim04:08:50

Do you have any examples of how to use a scrollview` ? 🙂

phronmophobic04:08:41

membrane.ui/scrollview is purely graphical

phronmophobic04:08:04

in other words, it doesn't provide any default event handlers

phronmophobic04:08:14

all the stuff in membrane.basic-components is fairly easy to wrap which is what I did to get the textarea to work with re-frame, https://github.com/phronmophobic/membrane/blob/master/src/membrane/re_frame.cljc#L61

phronmophobic04:08:48

if you give me a few moments, I can also wrap the scrollview for re-frame

genekim04:08:53

That would be amazing, @smith.adriane — in the meantime, I’ll study your textarea example. I’m still trying to understand how this all works. I appreciate all this help!!!

phronmophobic04:08:18

the underlying goal is to build a ui framework out of values and pure functions. there's a lot of benefits to going that route, but it means that you can't use the built in components from swing/html/etc that inextricably combine graphics and events

genekim04:08:58

I’ve got to put kids to bed — I will pick this up tomorrow! Exciting! PS: I’m starting to more fully grasp what you’ve created — wow…. I’m blown away that you’ve recreated so much from the ground-up. An amazing achievement!

phronmophobic04:08:22

have a good night. I really do appreciate the feedback!

genekim04:08:16

(And one of these days, I’ve gotta learn what drove you to this length to not just use what Swing/JavaFX give you. It must have really offended/hurt/scarred you!! 😂.

😁 3
phronmophobic16:08:07

I've wrapped basic-components/scrollview so you can use it from re-frame. there's an example here, https://github.com/phronmophobic/membrane-re-frame-example/blob/master/src/membrane_re_frame_example/views.clj#L159

phronmophobic16:08:57

I haven't used scrollviews that often, so I haven't put much time into it, but I now have some improvements in mind now that I've thought about it some more