GithubHelp home page GithubHelp logo

Copy/paste functionality about nuklear HOT 12 CLOSED

vurtun avatar vurtun commented on May 22, 2024
Copy/paste functionality

from nuklear.

Comments (12)

vurtun avatar vurtun commented on May 22, 2024

Actual system coping from/to clipboard is not planned, since it would require a lot of quite ugly platform dependent code that only a selected group would benefit from. Instead what I could do is provide a callback for coping out of a editbox and the user would then have to copy it to the clipboard.
As for pasting, that is even more difficult but could maybe be implemented with a callback as well.
So if you would be fine with just having callbacks than I could implement it in the near future.

from nuklear.

ktb92677 avatar ktb92677 commented on May 22, 2024

No no, I'm not by any means suggesting you implement any platform dependent code. (this and the simplicity of your library are the reasons why I've decided to use your GUI system over others) But what would be nice is like I want to be able to highlight text and right click and copy and right click to paste and such. Let the programmers fill in the platform related stuff as you have done with most everything else

from nuklear.

vurtun avatar vurtun commented on May 22, 2024

This could get a little bit more complicated so I cannot make any promises that I can finish it this week since I have to take a break for a few weeks to learn for my final exams. But I will try to finish it till sunday.

from nuklear.

ktb92677 avatar ktb92677 commented on May 22, 2024

Great! Thanks, I look forward to the update

from nuklear.

vurtun avatar vurtun commented on May 22, 2024

I added basic copy & paste of a user specified string for input boxes over callback. But for it to work you have to use the newly created struct editbox and the gui_panel_editbox API call and provided a copy & paste key input in struct gui_input. The actual key in this case does not matter so you could even use key combinations. The old versions with gui_panel_edit and gui_panel_edit_filterered are not affected and still do not have copy & paste but are still working. In addition the struct editbox does not have a freely movable cursor or text selection as for now, but maybe with a little bit of luck I can create a version with it tomorrow.

from nuklear.

ktb92677 avatar ktb92677 commented on May 22, 2024

Just a quick note here! Looks like the cursor doesn't adjust properly when you click backspace! Still testing your copy paste stuff. I'll give you an update soon.

As always thanks for all of your development time here!

from nuklear.

vurtun avatar vurtun commented on May 22, 2024

Hey,
the backspace behavior at least with ASCII seems to work fine for me, at least in the demos with absolutely correct font handling (nanovg, xlib). But I found a different bug for UTF-8. I decrement and therefore remove one character from the back of the editbox buffer. But actually I need to remove the last glyph, so it could very well be that your problem stems from that bug.

from nuklear.

ktb92677 avatar ktb92677 commented on May 22, 2024

Okay, so is this something I can implement or does it have to be modified on your end?

from nuklear.

vurtun avatar vurtun commented on May 22, 2024

I removed the bug so if it does not work now than I it looks like it is on your end.

from nuklear.

ktb92677 avatar ktb92677 commented on May 22, 2024

Thanks a bunch!

from nuklear.

ktb92677 avatar ktb92677 commented on May 22, 2024

Kind of more of a interpretive question, but are you planning on continuing to add more kinds of widgets and expand the features of this toolkit? I'm implementing this toolkit on a relatively large platform and continued development would put my heart to ease. No pressure obviously but I'm just curious what phase this project is in for you.

from nuklear.

vurtun avatar vurtun commented on May 22, 2024

OK this will be a little bit more personal. Like I already said I am currently in my last semester in university and I am currently studying for my last finals. Which means that the next few month are unpredictable and will probably contain a lot of change for me. So I cannot 100% guarantee that I will have as much time as I had while writing this library.
That being said I am personally committed to this library and use it myself to write an GDB debugger frontend (the file explorer screenshot in the gallery is from that project) to finally have a good linux debugger and learn more about this library in practice and find and extend it's boundaries and fix or add things that I personally need.
As for adding new widgets this is a complicated issue. First of if you need something just create a new issue and I will think about it and if possible create it. But to make things clear there are classic widget types in retain mode GUI's like combo boxes, trees and menus that I do not want to create since they can be replaced or simulated by using the already existing functionality and adding them would cause headache, consume a lot of time/energy and would complicate the library extremely.

So if you have a certain widget that you would like to have create an issue and I will either create it, show a different way to achieve the same goal or deny it (example.: combo boxes) since it would be to complicated to create. In addition it would be nice if when you create a issue for a new widget specify which problem you want to solve with it. This could at least help me to either provide a widget that is based on a actual use case or I can create an alternative way to achieve a solution.

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.