python-cui 1.4.0.6__cp39-cp39-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cui/__init__.py +87 -0
- cui/__init__.pyi +757 -0
- cui/_api.cp39-win_amd64.pyd +0 -0
- cui/_api.pyi +425 -0
- cui/_cui.cp39-win_amd64.pyd +0 -0
- cui/_cui.pyi +160 -0
- cui/_gen/COVERAGE.md +151 -0
- cui/_gen/__init__.py +1 -0
- cui/_gen/constants.py +813 -0
- cui/_gen/model.py +202 -0
- cui/_types.py +287 -0
- cui/py.typed +0 -0
- cui/ui.py +606 -0
- python_cui-1.4.0.6.dist-info/METADATA +221 -0
- python_cui-1.4.0.6.dist-info/RECORD +16 -0
- python_cui-1.4.0.6.dist-info/WHEEL +5 -0
cui/__init__.py
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""CUI for Python: immediate-mode native UI, drawn by a C library.
|
|
2
|
+
|
|
3
|
+
import cui
|
|
4
|
+
|
|
5
|
+
state = {"name": ""}
|
|
6
|
+
|
|
7
|
+
def frame(ui):
|
|
8
|
+
with ui.column(pad=24, gap=12):
|
|
9
|
+
ui.heading("Hello, CUI")
|
|
10
|
+
state["name"] = ui.text_input("name", value=state["name"], label="Name").text
|
|
11
|
+
|
|
12
|
+
cui.App().run(frame, title="Hello", width=900, height=600)
|
|
13
|
+
|
|
14
|
+
The widgets are CUI's own C components, called through generated Cython
|
|
15
|
+
wrappers; the low-level surface (one function per C function, option structs as
|
|
16
|
+
keyword arguments) lives in :mod:`cui._api`, and the friendly one in
|
|
17
|
+
:mod:`cui.ui`.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
from __future__ import annotations
|
|
21
|
+
|
|
22
|
+
import sys as _sys
|
|
23
|
+
|
|
24
|
+
from ._gen import constants as _constants
|
|
25
|
+
from ._cui import App, Context, DrawData, SoftwareRenderer, file_dialog
|
|
26
|
+
from ._types import (
|
|
27
|
+
CanvasResult,
|
|
28
|
+
ChartAnnotation,
|
|
29
|
+
Color,
|
|
30
|
+
Corners,
|
|
31
|
+
Date,
|
|
32
|
+
DotChartResult,
|
|
33
|
+
DotSeries,
|
|
34
|
+
EventTrackResult,
|
|
35
|
+
KeyCombo,
|
|
36
|
+
Rect,
|
|
37
|
+
Series,
|
|
38
|
+
Size,
|
|
39
|
+
SizeKind,
|
|
40
|
+
TextFlags,
|
|
41
|
+
TextMetrics,
|
|
42
|
+
TextResult,
|
|
43
|
+
Vec2,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
__version__ = "1.4.0.0"
|
|
47
|
+
CUI_VERSION = "1.4.0"
|
|
48
|
+
|
|
49
|
+
# Every enum and icon constant from CUI's headers: ThemeMode, Accent, Token,
|
|
50
|
+
# ButtonVariant, ControlSize, Tone, Key, Mod, ICON_PLUS, ...
|
|
51
|
+
globals().update({name: value for name, value in vars(_constants).items() if not name.startswith("_")})
|
|
52
|
+
|
|
53
|
+
# CUI spells the platform's main shortcut modifier as a macro alias.
|
|
54
|
+
Mod.PRIMARY = Mod.SUPER if _sys.platform == "darwin" else Mod.CTRL
|
|
55
|
+
|
|
56
|
+
from ._gen.model import * # noqa: E402,F403 (the plain data structs as NamedTuples)
|
|
57
|
+
from .ui import UI # noqa: E402
|
|
58
|
+
|
|
59
|
+
__all__ = [
|
|
60
|
+
"App",
|
|
61
|
+
"CanvasResult",
|
|
62
|
+
"ChartAnnotation",
|
|
63
|
+
"Color",
|
|
64
|
+
"Context",
|
|
65
|
+
"CUI_VERSION",
|
|
66
|
+
"Corners",
|
|
67
|
+
"Date",
|
|
68
|
+
"DotChartResult",
|
|
69
|
+
"DotSeries",
|
|
70
|
+
"DrawData",
|
|
71
|
+
"EventTrackResult",
|
|
72
|
+
"KeyCombo",
|
|
73
|
+
"Rect",
|
|
74
|
+
"Series",
|
|
75
|
+
"Size",
|
|
76
|
+
"SizeKind",
|
|
77
|
+
"SoftwareRenderer",
|
|
78
|
+
"TextFlags",
|
|
79
|
+
"TextMetrics",
|
|
80
|
+
"TextResult",
|
|
81
|
+
"UI",
|
|
82
|
+
"Vec2",
|
|
83
|
+
"__version__",
|
|
84
|
+
"file_dialog",
|
|
85
|
+
]
|
|
86
|
+
__all__ += [name for name in vars(_constants) if not name.startswith("_")]
|
|
87
|
+
__all__ += [name for name in vars(_sys.modules[__name__]) if name[:1].isupper() and name not in __all__]
|