Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

..._get_text functions not available #162

Open
Johennes opened this issue Mar 13, 2024 · 1 comment
Open

..._get_text functions not available #162

Johennes opened this issue Mar 13, 2024 · 1 comment

Comments

@Johennes
Copy link
Contributor

The ..._get_text functions on Label and Textarea don't seem to be available currently. I can get text by calling the C function in an unsafe block like this:

let mut textarea = Textarea::new()?;
unsafe {
    let text = CStr::from_ptr(lv_textarea_get_text(textarea.raw().unwrap().as_ptr()));
}

However, it would be nice if I could do textarea.get_text().

@C47D
Copy link
Collaborator

C47D commented Nov 24, 2024

The ..._get_text functions on Label and Textarea don't seem to be available currently. I can get text by calling the C function in an unsafe block like this:

let mut textarea = Textarea::new()?;
unsafe {
    let text = CStr::from_ptr(lv_textarea_get_text(textarea.raw().unwrap().as_ptr()));
}

However, it would be nice if I could do textarea.get_text().

What type should it return, c_str, String?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@Johennes @C47D and others