Skip to main content

A simplified wrapper for Dear ImGui and GLFW

Project description

Ara_imgui

Ara_imgui is a lightweight and easy-to-use wrapper around Dear ImGui using Python and GLFW. It simplifies GUI application development with ImGui by providing a convenient interface for managing windows, fonts, and application lifecycle.

Features

  • Simple ImGui app launch with a single run function
  • Support for multiple ImGui windows via the Window class
  • Built-in dark and light themes
  • System or custom font loading, including Cyrillic support
  • Ready-to-run examples included in the examples folder

Installation

pip install ara_imgui

Or install dependencies manually:

pip install glfw PyOpenGL imgui ara_core

⚠️ Make sure you have Python 3.7+ and OpenGL support (e.g., via GPU drivers on Windows).

Usage

Basic example

from ara_imgui import run, imgui

def gui():
    imgui.text("Hello, world!")
    if imgui.button("Click me"):
        print("Clicked!")

run(gui)

Multiple windows

from ara_imgui import App, Window, imgui

app = App("Multi-window App")

def win_ui():
    imgui.text("This is another window")

win = Window("Extra Window", frame_ui=win_ui)

def main_ui():
    imgui.text("Main Window")  
    if imgui.button("Open Extra Window"):
        app.add_window(win)

app.run(main_ui)

Custom fonts and themes

from ara_imgui import App, imgui

app = App("Font Example")
app.apply_theme("light")
app.load_font(font_size=18)

def gui():
    imgui.text("Sample text with custom font")

app.run(gui)

API

run(frame_ui, **kwargs)

Minimal interface to launch the application.

Parameters:

  • frame_ui: Function to render the main UI.
  • callback: Function called after frame_ui (optional).
  • title: Window title.
  • width, height: Window size.
  • theme: "dark" or "light".
  • custom_font: False, True, or path to a .ttf file.
  • font_size: Font size.
  • cyrillic_ranges: Include Cyrillic character ranges (True by default).

Classes

  • App — The main application class.
  • Window — Represents a separate ImGui window with its own logic.

Examples

See the examples/ folder:

  • hello_world.py — Basic "Hello, world!" with a button.
  • basic_window.py — Simple window with input field.
  • custom_font.py — Font and multilingual text rendering.
  • multiple_window.py — GUI with multiple ImGui windows.

Dependencies

  • ara_core
  • imgui
  • glfw
  • PyOpenGL

License

MIT License. Free to use and modify.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ara_imgui-1.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ara_imgui-1.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file ara_imgui-1.1.0.tar.gz.

File metadata

  • Download URL: ara_imgui-1.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for ara_imgui-1.1.0.tar.gz
Algorithm Hash digest
SHA256 27974a69151add7d06fdb8e39e6ba214ba0d4a773400099afdea87f1b1225f8f
MD5 0e2c1687b8d95df04a3f57239035f000
BLAKE2b-256 2700c6358980a2c7ff6c0b24b306305d76127cb0552e7888b88075f4c4c4099e

See more details on using hashes here.

File details

Details for the file ara_imgui-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: ara_imgui-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for ara_imgui-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38ba2457d1896a62cc4f5d4292a33ae576d914384753c7a806d5906160170ec9
MD5 f04491ae5931deaffde48d43ac5aa85f
BLAKE2b-256 eb7f1602bb2b8b5fc7f16d57e60546b77950eb4f6253f12d19fa199a061d16b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page