gui_text_box, gui_value_box_float, gui_text_input_box now take a mut buffer - #30
Open
nepinhum wants to merge 5 commits into
Open
gui_text_box, gui_value_box_float, gui_text_input_box now take a mut buffer#30nepinhum wants to merge 5 commits into
nepinhum wants to merge 5 commits into
Conversation
|
@spytheman, @EmmaTheMartian, @medvednikov It might be more convenient for users to have both the May want to double check solutions against a V version of the controls test suite. |
Keep unload_file_text/unload_utf8 as string, fix text_append, add raygui example
Author
|
I currently don’t have access to my PC, so many thanks to @xRookieFight for contributing the follow up changes and running the interactive tests. Using the added raygui_controls.v example, the proposed &u8 bindings were tested with V 0.5.2 (282bf30 and 8dc873b) GuiTextBox, GuiValueBoxFloat and GuiTextInputBox all accepted edits and correctly updated their V side backing buffers. Backspace and capacity limits also behaved correctly with no observed overflow so far. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #29.
gui_text_boxcouldn't actually be edited because itstextparameter wasbound as a V
stringand passed to C as.str. V strings are immutable andsized to their exact contents but
GuiTextBox()writes directly into thatpointer while
editModeis on. So editing either silently did nothing or wrote past the string's allocation.(still becomes a V string) from plain char * (now becomes &u8). Regenerating the bindings later won't reintroduce this bug.