Comments (3)
Unfortunately there is no such widget in place (there were some disagreements what should be the feature set of a minimal grid widget, but because Nuklear matured, I think we could afford also such complex widgets - feel free to make a PR 😉).
How to do such widget? Well, I think your approach is not bad. The only thing many people struggle with is the changes (the x- and/or y- overall size of the grid, the column and/or row order, the cell merges & splits, etc.). But this has actually a simple solution - just make indexing indirect by one more "higher level" dereference. Imagine you could access your data only by using the A1
(CD153
, etc.) notation. In that case you'd have a function taking such string as an argument (together with a pointer to the "object" holding all the actual data) and returning a currently valid pointer to the underlying plain array of cells (or any convenient data structure). This function resembles a hash map of pointers to the actual data. Such addressing scheme handles changes, merges/joins, splits etc. quite well, is more or less efficient and not so difficult to implement.
See also the libs behind LibreOffice Calc:
- https://gitlab.com/orcus/orcus/blob/master/README.md
- https://gitlab.com/mdds/mdds
- https://gitlab.com/ixion/ixion
from nuklear.
Actually I just need to display my data in grid format, not really make an excel like app. If I can have a label with borders and background color I'll be satisfied. Is there a widget like that ? I don't mind using low level stuff.
from nuklear.
Is there a widget like that ?
There are several types of buttons (changing theme before and after button calls could imitate no reaction to mouse hover etc.) and other rectangular widgets. You can always ignore/clear mouse input when using them, so to make them "static" (non-changing). There is of course also low level stuff, but I think it's not needed. Just look at Nuklear examples, demos, backends and of course the source code of nuklear.h
itself and you'll find your way pretty quickly 😉.
from nuklear.
Related Issues (20)
- Backspace does not actually clear a buffer when using nk_edit_string HOT 4
- File Menu HOT 6
- Request: create example for showcasing integration with RGFW HOT 2
- How to make own title bar, without using the operating systems HOT 3
- Group margins/alignment Ubuntu HOT 3
- Demo doesn't include code on how to display images without OpenGL. HOT 1
- After set an opened Combo Box to invisible, no response from the entire window.
- How to do multiple render with one update HOT 2
- Events not working with multiple Nuklear windows
- Add `delta_time_seconds` to each renderer
- GUI "cards" HOT 6
- Multiple window instances HOT 2
- Inputs propagating to windows in background HOT 1
- No documentation explaining how to convert an nk_rune to a char. HOT 1
- Fragment shader used in the GLFW GL4 wrapper doesn't compile
- Getting some strange text clipping behavior when dragging windows around. HOT 1
- prefilling and updating an nk_edit_string while allowing manual editing ?
- 2 errors HOT 2
- Can`t assemble from src in msvs win HOT 2
- feature request: extend NO_SCROLLBAR with horizontal/vertical options HOT 2
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 nuklear.