-
Notifications
You must be signed in to change notification settings - Fork 150
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
Unable to remove status bar from raygui Panels #386
Comments
Why do you think that the expected result is a panel with no status bar? Does that behavior differ from C behavior? The function just says bounds and text, with no mention of the status bar. |
Yes it's in the C implementation. I've used it pretty recently. I'm not familiar with cgo, but if you do a length check in the string, I assume you can pass null instead of a blank string. |
Some reproducible example would be nice, you mention Panel, and then you link to ScrollPanel. I am guessing based on the checks you sent that some function should pass |
The implementation is the same for both panel and scroll panel... As far as an example goes, I don't have much time to provide one at the moment. Both your project and the original C implement have Scroll panel examples. It's possible to check those |
@gen2brain I think you are right. Here is the current state (I ran the example And here with a nil passed (JupiterRider@c212c33): |
Nice implementation @JupiterRider my only gripe would be to do a nil check in the free so we don't attempt to free a nil pointer |
@michaeldelgado1 var ctext *C.char
if len(text) > 0 {
ctext = C.CString(text)
defer C.free(unsafe.Pointer(ctext))
} |
I totally missed that. Thanks for pointing it out. I was reading on mobile 🤦 |
@JupiterRider Nice, can you send the PR? Is that the only function/place where it needs nil? |
@gen2brain I don't know every place, where a NULL string affects the appearance, but C-raygui has NULL-checks, so we can safely pass them instead of an empty string. |
Code example:
Expected Result:
A panel is drawn with no status bar
Actual Result:
A panel is drawn with a status bar and no text
The text was updated successfully, but these errors were encountered: