Comments (3)
One solution is to simply add the full range as a second parameter to the closure:
let mut batch = vec![];
table_builder
.header(re_ui::DesignTokens::table_line_height(), header_ui)
.body(|body| {
body.rows(line_height, row_count, |row, row_range: Range<usize>| {
if row.index() == row_range.start {
batch = load_batch(row_range);
}
show(row, batch);
});
});
However, that's maybe not the most ergonomic.
An alternative is
table_builder
.header(re_ui::DesignTokens::table_line_height(), header_ui)
.body(|body| {
body.rows_ext(line_height, row_count,
|row_range: Range<usize>| load_batch(row_range),
|batch, row| show(row, batch)
);
});
from egui.
Either would be fine for me. The former needs to guarantee that the closure is called in the correct order. The latter is slightly weird wrt to ownership (I assume body
take ownership of the first closure's returned value, and only provides a mutable(?) ref to the second closure)?
Wonder if a trait based API could be more ergonomics, as it could encompass everything (header row(s), on_row_batch()
, on_row()
, cell-based callback to accommodate for #5001).
from egui.
Done in https://github.com/rerun-io/egui_table
from egui.
Related Issues (20)
- Better vertical text centering HOT 1
- eframe touchscreen requires double tap to single click HOT 2
- How can I run in the background?
- Run `App::update` even when hidden HOT 2
- `App::tick`
- Add support for asymmetric sizing to `Sides` HOT 1
- Partial texture updates will update the sampler in `egui_glow` but not `egui_wgpu`
- Getting PERF_WARNING: request_discard has been called X frames in a row HOT 1
- Layer sublayers have an invisible bounding box HOT 1
- Wayland: `request_repaint` ignored if minimized
- Improve `Area` sizing with dynamic content HOT 3
- context_menus as separate windows HOT 3
- Wayland: app freezes if viewport is behind main window
- Layout Issue with `CollapsingState` HOT 2
- Unhandled user callback exception on dynamic library interaction
- Configuration options for color picker layout/style HOT 1
- N/A
- Window decorations still rendered when fullscreen set to true
- Give error msg when image fails to render HOT 1
- hex_color!() macro is not const HOT 1
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.