Comments (7)
Yep, that's what I do. Not 100% happy about it, but it works good enough.
from cljfx.
I released a new version 1.6.7 which adds :on-width-changed
and :on-height-changed
props for a scene as well: it does not include window title bar.
Some day I'll go through all read-only properties and add change listener props for them...
from cljfx.
Lifecycle is a behavior that manages how things get created from description, changed to other value from previously created when description changes, and destroyed when description no longer exists. There are many of them for different kinds of situations.
As a user, you can consider lifecycle/event-handler
and lifecycle/change-listener
an implementation details that are irrelevant and just remeber this rule: all props for observing changes accept either a function or a map:
;; with this description it'll print whenever width is changed, useful for
;; trying props for observing changes
{:fx/type :stage
:on-width-changed #(prn :on-width-changed %)}
;; with this description your map event handler will receive map like
;; {:foo "bar" :fx/event new-value}
{:fx/type :stage
:on-width-changed {:foo "bar"}}
Hooking up another entry in my event handler multimethod doesn't seem to be working properly
Can you tell me how it is not working properly? Your renderer setup looks perfectly fine, I think, the only thing I would have changed there is replace (fx/wrap-map-desc assoc :fx/type root)
with (fx/wrap-map-desc #(assoc % :fx/type root))
so it will access root
through var lookup: it allows redefining root
during development be reflected in app updates.
from cljfx.
I guess I was on the right track :) The issue turned out to be just an old version of cljfx that didn't have that property. Now everything is hooked up and working sorta
In your workflow how do you typically go about inspecting the available props from the REPL? Do you just open up the cljfx source a poke around?
from cljfx.
Thanks again for your help and guidance :)
from cljfx.
Hey @vlaaad , I think I found a lingering issue with using :on-height-changed
stage/window events
It seem to ends up including the height of the window titlebar. And there is no clear way to subtract the title bar size. I can bake in some value for my machine, but the title bar will change between machines?
Do you have some workaround for tracking the actual size of the scene?
it's a bit silly, but I have a sub element that is rendered in a separate library, so i need to calculate the size it has available and then render it to the correct size so it fits
from cljfx.
Thank you for pushing that addition :)) . I'm sorry I'm not able to make a PR myself. I'm still trying to grok the internals
from cljfx.
Related Issues (20)
- Spinner Example
- controlsfx, CheckComboBox HOT 7
- depstar is deprecated and archived; switch to tools.build HOT 2
- The example project fails with (UnsupportedOperationException) HOT 6
- Mouseclick and textfield ?
- Support for CheckBoxTreeItem/CheckBoxTreeCell
- Method for adding another context-like property HOT 1
- Runnning examples/e20_markdown_editor results in NullPointerException: HOT 1
- How do I use StyledTextArea or any new class? HOT 2
- Broken encoding for Sanskrit text in WebView HOT 2
- How do I exit the packaged app on window close or menu quit command HOT 2
- Unable to open DISPLAY HOT 4
- Trying to understand the lifecycle again
- Using cljfx with Gradle HOT 2
- Problem using leiningen HOT 2
- how to pass args to constructors HOT 3
- how to set the background of a region HOT 5
- Children: duplicate children added: when using pie-chart and dynamic rendering HOT 3
- Memory reuse with `fx/ext-instance-factory` HOT 5
- behavior of tree cell factory
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cljfx.