GithubHelp home page GithubHelp logo

Comments (3)

dumblob avatar dumblob commented on July 20, 2024

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:

  1. https://gitlab.com/orcus/orcus/blob/master/README.md
  2. https://gitlab.com/mdds/mdds
  3. https://gitlab.com/ixion/ixion

from nuklear.

kamil-zubair avatar kamil-zubair commented on July 20, 2024

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.

dumblob avatar dumblob commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.