Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pi_task:
- make -j2
- cp raylib/libraylib.a /usr/local/lib/libraylib.a
build_script:
- patch -p0 <raygui.h.diff
- cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
- cp physac/src/physac.h /usr/local/include/
- cp raygui/src/raygui.h /usr/local/include/
Expand Down Expand Up @@ -134,6 +135,7 @@ mac_task:
- make -j8
- sudo cp raylib/libraylib.a /usr/local/lib/libraylib.a
build_script:
- patch -p0 <raygui.h.diff
- sudo cp -r raylib-c/src/external/glfw/include/GLFW /usr/local/include/
- sudo cp physac/src/physac.h /usr/local/include/
- sudo cp raygui/src/raygui.h /usr/local/include/
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
with:
submodules: recursive

- name: fix raygui bug
run: |
patch -p0 <raygui.h.diff

- name: Build SDL
run: |
wget https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.30.7.tar.gz
Expand Down Expand Up @@ -195,6 +199,10 @@ jobs:
with:
submodules: recursive

- name: fix raygui bug
run: |
patch -p0 <raygui.h.diff

- name: Setup Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -278,6 +286,10 @@ jobs:
with:
submodules: recursive

- name: fix raygui bug
run: |
patch -p0 <raygui.h.diff

- name: Download SDL2
run: curl -L -o SDL2.zip https://github.com/libsdl-org/SDL/releases/download/release-2.30.8/SDL2-devel-2.30.8-VC.zip

Expand Down Expand Up @@ -359,6 +371,10 @@ jobs:
with:
submodules: recursive

- name: fix raygui bug
run: |
patch -p0 <raygui.h.diff

- name: Setup Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -406,6 +422,10 @@ jobs:
with:
submodules: recursive

- name: fix raygui bug
run: |
patch -p0 <raygui.h.diff

- name: Setup Python
uses: actions/setup-python@v5
with:
Expand Down
31 changes: 31 additions & 0 deletions raygui.h.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--- raygui_buggy/src/raygui.h 2025-08-25 20:37:15.268489729 +0100
+++ raygui/src/raygui.h 2025-08-25 20:38:02.052486927 +0100
@@ -696,8 +696,8 @@
RAYGUIAPI Font GuiGetFont(void); // Get gui custom font (global state)

// Style set/get functions
-RAYGUIAPI void GuiSetStyle(int control, int property, int value); // Set one style property
-RAYGUIAPI int GuiGetStyle(int control, int property); // Get one style property
+RAYGUIAPI void GuiSetStyle(int control, int property, unsigned int value); // Set one style property
+RAYGUIAPI unsigned int GuiGetStyle(int control, int property); // Get one style property

// Styles loading functions
RAYGUIAPI void GuiLoadStyle(const char *fileName); // Load style file over global style variable (.rgs)
@@ -1557,7 +1557,7 @@
}

// Set control style property value
-void GuiSetStyle(int control, int property, int value)
+void GuiSetStyle(int control, int property, int unsigned value)
{
if (!guiStyleLoaded) GuiLoadStyleDefault();
guiStyle[control*(RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED) + property] = value;
@@ -1570,7 +1570,7 @@
}

// Get control style property value
-int GuiGetStyle(int control, int property)
+unsigned int GuiGetStyle(int control, int property)
{
if (!guiStyleLoaded) GuiLoadStyleDefault();
return guiStyle[control*(RAYGUI_MAX_PROPS_BASE + RAYGUI_MAX_PROPS_EXTENDED) + property];
4 changes: 2 additions & 2 deletions raylib/raygui.h.modified
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,8 @@ typedef enum {
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiSetFont(Font font); // Set gui custom font (global state)
/* Functions defined as 'extern' by default (implicit specifiers)*/ Font GuiGetFont(void); // Get gui custom font (global state)
// Style set/get functions
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiSetStyle(int control, int property, int value); // Set one style property
/* Functions defined as 'extern' by default (implicit specifiers)*/ int GuiGetStyle(int control, int property); // Get one style property
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiSetStyle(int control, int property, unsigned int value); // Set one style property
/* Functions defined as 'extern' by default (implicit specifiers)*/ unsigned int GuiGetStyle(int control, int property); // Get one style property
// Styles loading functions
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiLoadStyle(const char *fileName); // Load style file over global style variable (.rgs)
/* Functions defined as 'extern' by default (implicit specifiers)*/ void GuiLoadStyleDefault(void); // Load style default over global style
Expand Down
20 changes: 20 additions & 0 deletions tests/test_raygui_style.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from pyray import *

init_window(400, 200, "raygui - controls test suite")
set_target_fps(60)


while not window_should_close():
# Draw
#----------------------------------------------------------------------------------
begin_drawing()
clear_background(get_color(abs(gui_get_style(DEFAULT, BACKGROUND_COLOR))));

gui_button(Rectangle(24, 24, 320, 30), "#191#Background should be white")



end_drawing()


close_window()
Loading