Skip to main content

"PUI" Python Declarative UI Framework

Project description

Install

pip install QPUIQ

Example

Code

import PUI
PUI.BACKEND = "PySide6"
from PUI import State
from PUI.generic import *

data = State()
class Example(Window):
    def __init__(self):
        super().__init__(title="blah", size=(640,480))
        data.var = 50

    def content(self):
        with VBox():
            with Canvas():
                CanvasText(data.var, data.var/2, f"blah {data.var}")
                CanvasLine(data.var, data.var, data.var*2, data.var*3)
            with HBox():
                Button("-", self.on_minus)
                Label(f"{data.var}")
                Button("+", self.on_plus)

    def on_minus(self):
        data.var -= 1

    def on_plus(self):
        data.var += 1

root = Example()
root.run()

UI

Qt Canvas Example

DOM

Example {
  QtVBox {
    QtCanvas {
      QtCanvasText {

      },
      QtCanvasLine {

      }
    },
    QtHBox {
      QtButton {

      },
      QtLabel {

      },
      QtButton {

      }
    }
  }
}

More Example

See examples/*.py

Progress

  • State
    • Update Trigger
    • Binding
    • List/Dict and Lazy UI
  • Verify Nested View
  • Adapters
    • Split Application/Window
    • Label
    • Button
    • TextField
    • Layout
      • HBox
      • VBox
      • ZBox
      • Grid
        • Row
        • Column
    • Canvas
      • Text
      • Line
      • Rect
      • Arc
      • Image
      • ...
    • Table
    • Tree
    • Scrollbar
  • Better DOM syncer
    • Prevent unnecessary nested update
    • Trace Event Source (TextField) and prevent udpate it DOM Sync
    • update() -> sync()/inflate()/update()

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

QPUIQ-0.1.2.tar.gz (9.8 kB view hashes)

Uploaded Source

Supported by

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