Comments (11)
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 nil
if the string is empty but that is just a guess.
from raylib-go.
@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.
from raylib-go.
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.
from raylib-go.
Yes it's in the C implementation.
https://github.com/raysan5/raygui/blob/12804826d01bfb636e36f816bda19eaa23b4ace7/src/raygui.h#L1793
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.
from raylib-go.
Here's a better link:
https://github.com/raysan5/raygui/blob/12804826d01bfb636e36f816bda19eaa23b4ace7/src/raygui.h#L1891
from raylib-go.
The implementation is the same for both panel and scroll panel...
https://github.com/raysan5/raygui/blob/12804826d01bfb636e36f816bda19eaa23b4ace7/src/raygui.h#L1693
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
from raylib-go.
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
nil
if the string is empty but that is just a guess.
@gen2brain I think you are right.
Here is the current state (I ran the example gui/scroll_panel/scroll_panel.go
):
And here with a nil passed (JupiterRider@c212c33):
from raylib-go.
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
from raylib-go.
@michaeldelgado1
The free is inside the if statement:
var ctext *C.char
if len(text) > 0 {
ctext = C.CString(text)
defer C.free(unsafe.Pointer(ctext))
}
from raylib-go.
I totally missed that. Thanks for pointing it out. I was reading on mobile 🤦
from raylib-go.
@JupiterRider Nice, can you send the PR? Is that the only function/place where it needs nil?
from raylib-go.
Related Issues (20)
- [IMPORTANT] GLFW error and wrong (0,0) position HOT 11
- WASM HOT 1
- Building for Android arm64 HOT 2
- Intermittent SIGBUS: bus error When uploading a custom mesh to gpu HOT 1
- log android HOT 2
- how get jni acces? HOT 9
- cannot locate symbol "internal_storage_path" HOT 12
- Dear IMGUI support HOT 1
- 2 or 3 second build times? HOT 2
- Misleading use of color type RGBA. HOT 2
- No function for `GuiLoadIcons` HOT 1
- Cross compiling error HOT 6
- Can't debug via go-delve on M1 MacOS. (missing rodata struct member) HOT 1
- Issues with using DLL on Windows HOT 1
- Adding `SwapScreenBuffer()` and `PollInputEvents()` functions HOT 3
- Can not build for windows/darwin HOT 2
- errors with camera on fedora HOT 3
- Not support win7? Is there any way to work with win7? HOT 3
- delve fails to build, can't find utils_log.h HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raylib-go.