Skip to content

The function gui_text_box might need an extra parameter #29

Description

@Wajinn

The problem surfaces when attempting to make a text box editable. This would also show up if making the V version of the Raygui controls test suite example. The present function won't allow a user to directly change the text in the text box control. It would remain as whatever was the default string assigned.

pub fn gui_text_box(bounds Rectangle, text string, text_size int, edit_mode bool) int

One possible solution is for the V version of the function to have 2 parameters, where one is &u8 and the other is string. If you don't want the gui_text_box content to be editable, then use type string and this is given to the C function as text.str. If you want to allow users to change the content, then maybe use type &u8 and cast to &char. The difference can be distinguished by an if statement in the body of the new function. Just a suggestion, as there can be different ways to get the same result.

pub fn gui_text_box(bounds Rectangle, edit &u8, text string, text_size int, edit_mode bool) int

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions