Comments (2)
I have no idea what you are referring to. Please explain, perhaps referring to existing code and/or adding some code example.
from egui.
Sorry, I should've clarified. What I'm referring to is the from_get_set
method that sliders and drag values have:
Doing a quick search, I realized that expanding this to other widgets may also be a good idea. The main thing this benefits is audio plugins. When you're doing the editor UI, you don't have a direct mutable reference you can use. Here's an example from nih_plug:
ui.add(
egui::widgets::Slider::from_get_set(-30.0..=30.0, |new_value| {
match new_value {
Some(new_value_db) => {
let new_value = util::gain_to_db(new_value_db as f32);
setter.begin_set_parameter(¶ms.gain);
setter.set_parameter(¶ms.gain, new_value);
setter.end_set_parameter(¶ms.gain);
new_value_db
}
None => util::gain_to_db(params.gain.value()) as f64,
}
})
.suffix(" dB"),
);
When reading this for the first time, the Option
in the closure doesn't immediately make sense.
from egui.
Related Issues (20)
- Gif Support HOT 1
- Custom light & dark themes on system theme change HOT 1
- Add a User-Agent header to HTTP image loader HOT 5
- Dithering in Fragment Shader HOT 1
- moving the mouse outside of the window will still cause the window to update
- Mobile web text editing tracking issue
- `include_image!` macro should take in an `expr` not a `literal`
- Phantom key presses when focusing an egui/winit window HOT 3
- Configurable plot cursor "snap" radius HOT 1
- TableBuilder / available_width() HOT 1
- Smooth zooming
- High CPU usage when accesskit enabled HOT 11
- Crashing on startup HOT 4
- Zoom out the plot with right mouse drag
- Store a Ui/Frame-stack
- Sizing-pass flag
- Wayland dependencies are pulled in for eframe, even when `wayland` feature is disabled. HOT 1
- egui_plot legend: add shortcut to hide all series but this one
- Grid layout for windows HOT 2
- Input not focused when selecting text
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 egui.