Gooey GUI Library
Gooey is a lightweight and feature-rich GUI (Graphical User Interface) library originally designed for X11 environments but now cross-platform. It provides a range of customizable widgets and layouts for creating responsive and modern desktop applications. The library is optimized for simplicity and offers a flexible API for developers.
Features
- Wide Range of Widgets:
- Labels
- Buttons
- Checkboxes
- Radio Buttons (and Groups)
- Sliders
- Dropdown Menus
- Textboxes
- Canvas
- Layouts:
- Horizontal
- Vertical
- Grid-based layouts
- Customization Options:
- Support for widget-specific callbacks
- Styling with predefined color schemes
- Interactive hover and click states
- Event Handling:
- Mouse clicks, motion, and keypress events
- Dynamic updates through an efficient redraw system
- Simple signaling system
Getting Started
- Clone repo
git clone https://github.com/YASSINE-AA/GooeyGUI.git
- Update submodules:
git submodule update --init --force --remote
- Apply patches:
./scripts/apply-cjson-submodule-patch.sh
- Init Cmake
cmake -S . -B build
cd build
make all
- Run example
cp examples/roboto.ttf build/
./example_basic
Prerequisites
Ensure your development environment includes:
- X11 Development Libraries: Gooey relies on X11 (
<X11/X.h>
, <X11/Xlib.h>
, <X11/Xutil.h>
).
- GLFW Development Library: Gooey relies on GLFW (
<GLFW/glfw3.h>
).
- OpenGL Development Library: Gooey relies on GLAD (
<GLAD/glad.h>
).
- cJSON Development Library: Gooey relies on cJSON (
<cjson/cJSON.h>
).
Installation
To integrate Gooey into your project:
- Include
gooey.h
in your project directory.
- Add
#include "gooey.h"
to your source files.
- Link libraries.
Example Usage
#include <stdio.h>
bool state = 0;
GooeyWindow msgBox;
void messageBoxCallback(int option)
{
LOG_INFO("MessageBox option: %d", option);
}
void onButtonClick()
{
state = !state;
}
int main()
{
set_logging_enabled(true);
set_minimum_log_level(DEBUG_LEVEL_INFO);
return 0;
}
void GooeyWindow_MakeVisible(GooeyWindow *win, bool visibility)
void GooeyWindow_Cleanup(int num_windows, GooeyWindow *first_win,...)
Cleans up the resources associated with the Gooey windows.
GooeyWindow GooeyWindow_Create(const char *title, int width, int height, bool visibility)
Creates a new Gooey window.
int Gooey_Init(GooeyBackends backend)
Initializes the Gooey system with the specified backend.
void GooeyWindow_Run(int num_windows, GooeyWindow *first_win,...)
Runs the Gooey window.
void GooeyMessageBox_Show(GooeyWindow *msgBoxWindow)
Displays the specified message box window.
GooeyWindow GooeyMessageBox_Create(const char *title, const char *message, MSGBOX_TYPE type, void(*callback)(int option))
Creates a message box window.
Documentation
- You can find the full API documentation here.
Contributing
Contributions are welcome! If you have suggestions or encounter issues, feel free to open an issue or submit a pull request.
License
Gooey is released under the GPL3 License.
Start building interactive and modern desktop applications with Gooey today!