Code Monkey home page Code Monkey logo

Comments (3)

vurtun avatar vurtun commented on August 20, 2024

Hey,
thanks for your feedback. I was not sure if it is possible but I had an idea so I tested it out
and it seems to work. But for this to work you have to use zr_edit and not provide a
cursor by just passing NULL. The more complex zr_edit_box and zr_edit_field do not work
since the modification between frames is not extractable outside the function.
In addition you have to provide an additional buffer with the same size to copy the
placeholder symbol into (this can be any character you want even unicode characters like )
After the box was updated you just have to check for the changes and if anything was added just
add it to your password buffer.

/* frame persistent data */
static char password[16];
static size_t length;
static int active;

/* password edit */
size_t i = 0;
char buffer[16];
size_t old_len = length;
for (i = 0; i < length; ++i) buffer[i] = '*';
zr_edit(&layout, password, &length, 16, &active, NULL, ZR_INPUT_DEFAULT);
if (old_len < length)
    memcpy(&password[old_len], &buffer[old_len], length - old_len);

from nuklear.

stfacs avatar stfacs commented on August 20, 2024

Thank you so much for the reply! It helped a lot, I was able to use your example and adapt it and get it to work! Thanks again

from nuklear.

vurtun avatar vurtun commented on August 20, 2024

Glad that I could help. I will close the issue then.

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.