Skip to content

covao/ChibiUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChibiUI

ChibiUI is a tiny Python GUI framework that makes it easy to build user interfaces with Tkinter. It wraps Tkinter so you can create scrollable, auto-layout GUIs with very little code.

✨ Features

  • Lightweight wrapper for Tkinter
  • Scrollable and auto layout
  • Tree navigation with simple path syntax
  • Minimal API, easy to use
  • Headless mode for testing without a GUI

📦 Installation

Method 1: Install library using pip:

pip install git+https://github.com/covao/ChibiUI

Method 2: Download the source code

Download chibiui.py and place it in your project directory

Uninstall

pip uninstall chibiui

Example

from chibiui import chibiui
imort time

ui = chibiui("ChibiUI Example")
ui.add_textbox("Title", "Personal Data")

# Navigation tree items are created automatically from the path
ui.add_textbox("Person/Name", "John Doe")
ui.add_selector("Person/Gender", ["Male", "Female", "Other"], "Male")
ui.add_slider("Person/Age", 0, 100, 1, 30)
ui.add_checkbox("Person/Add File", True)
ui.add_browse_file("Person/Select File")
ui.add_button("Person/Submit", False)

ui.add_textbox("Option/Country", "Japan")

while ui.alive:
    if ui.get("Person/Submit"):
        print("Submit button pressed!")
        print("Title:", ui.get("Title"))
        print("-- Personal Info --")
        print("Name:", ui.get("Person/Name"))
        print("Gender:", ui.get("Person/Gender"))
        print("Age:", ui.get("Person/Age"))
        print("Select File:", ui.get("Person/Select File"))
        print("Country:", ui.get("Option/Country"))
        print("---")
        ui.set("/Person/Submit", False)
    # Prevent high CPU usage
    time.sleep(0.01)
print("End")

API Reference

  • chibiui(title, nogui): Create the UI. Set nogui=True for headless mode.
  • add_textbox(path, value): Add a text input field.
  • add_selector(path, options, value): Add a dropdown selector.
  • add_slider(path, min_val, max_val, step, value): Add a slider input.
  • add_checkbox(path, value): Add a checkbox.
  • add_browse_file(label): Add a file selection button and text field.
  • add_button(path, value): Add a button.
  • get(path): Get the value for a path.
  • set(path, value): Set the value for a path.
  • alive: True if the UI is running.

ChibiUI

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages