Gooey GUI Library
Loading...
Searching...
No Matches
Gooey GUI Library

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

  1. Clone repo
    git clone https://github.com/YASSINE-AA/GooeyGUI.git
  2. Update submodules:
    git submodule update --init --force --remote
  3. Apply patches:
    ./scripts/apply-cjson-submodule-patch.sh
  4. Init Cmake
    cmake -S . -B build
    cd build
    make all
  5. 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:

  1. Include gooey.h in your project directory.
  2. Add #include "gooey.h" to your source files.
  3. Link libraries.

Example Usage

#include "gooey.h"
#include <stdio.h>
bool state = 0;
GooeyWindow msgBox;
void messageBoxCallback(int option)
{
LOG_INFO("MessageBox option: %d", option);
}
void onButtonClick()
{
state = !state;
GooeyWindow_MakeVisible(&msgBox, state);
}
int main()
{
set_logging_enabled(true);
set_minimum_log_level(DEBUG_LEVEL_INFO);
Gooey_Init(GLFW);
GooeyWindow win = GooeyWindow_Create("Hello World", 400, 300, 1);
msgBox = GooeyMessageBox_Create("Hello", "Welcome to Gooey!", MSGBOX_INFO, messageBoxCallback);
GooeyButton_Add(&win, "Click Me", 150, 100, 100, 40, onButtonClick);
GooeyWindow_Run(2, &win, &msgBox);
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.
GooeyButton * GooeyButton_Add(GooeyWindow *win, const char *label, int x, int y, int width, int height, void(*callback)())
Adds a button to the 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!