// Basic controls set
RAYGUIAPI int GuiLabel(Rectangle bounds, const char *text); // Label control, shows text
RAYGUIAPI int GuiButton(Rectangle bounds, const char *text); // Button control, returns true when clicked
RAYGUIAPI int GuiLabelButton(Rectangle bounds, const char *text); // Label button control, show true when clicked
RAYGUIAPI int GuiToggle(Rectangle bounds, const char *text, bool *active); // Toggle Button control, returns true when active
RAYGUIAPI int GuiToggleGroup(Rectangle bounds, const char *text, int *active); // Toggle Group control, returns active toggle index
RAYGUIAPI int GuiToggleSlider(Rectangle bounds, const char *text, int *active); // Toggle Slider control, returns true when clicked
RAYGUIAPI int GuiCheckBox(Rectangle bounds, const char *text, bool *checked); // Check Box control, returns true when active
RAYGUIAPI int GuiComboBox(Rectangle bounds, const char *text, int *active); // Combo Box control, returns selected item index
GuiButton returns a non-zero value when clicked, but GuiToggle always returns 0. The docs are a bit unclear on that, and the signature is misleading (because it returns an int).
My suggestion is to do one of these options:
change return-value to void; Given that you've expressed intent to give all functions a similar signature, I don't think you like that.
return a non-zero value when active (as long as it is active)
return a non-zero value when activated (only when the active-state changes from false to true), to match the button behavior. Useful for my specific use-case as I want to do something when the state changes, but might also be pretty confusing for those that don't read the docs.
change nothing, just update the docs.
I'm fine with providing a PR with any of these suggestions, if you let me know if you're okay with any of these suggestions.
GuiButton returns a non-zero value when clicked, but GuiToggle always returns 0. The docs are a bit unclear on that, and the signature is misleading (because it returns an
int
).My suggestion is to do one of these options:
void
; Given that you've expressed intent to give all functions a similar signature, I don't think you like that.I'm fine with providing a PR with any of these suggestions, if you let me know if you're okay with any of these suggestions.