Closed markusbkk closed 1 week ago
@markusbkk raygui is an immediate-mode library and consequently most data life-span is usually restricted to frame. GuiIconText()
returns a static string to be used at that same moment, if that string needs to be stored, that's up to the user.
Consequently, you should manage the memory allocations on user side, because raygui
does not allocate data dynamically.
Solution:
configDialog.name = (char *)calloc(1024);
strcpy(configDialog.name, GuiIconText(ICON_GEAR, "Settings"));
...
free(configDialog.name);
I spent the past few hours investigating this, after my own little application consistently drew the wrong icon and text for a
WindowBox
.I use C++ and built my own little dialog classes with a
.name
property.When I tried setting their name via
I was surprised to find that
configDialog
ended up displaying the text and icon meant forobjectDialog
.Is there a particular reason we can't just do
here?