barewingui 0.2.0b1__tar.gz
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.
- barewingui-0.2.0b1/LICENSE.md +21 -0
- barewingui-0.2.0b1/PKG-INFO +191 -0
- barewingui-0.2.0b1/README.md +166 -0
- barewingui-0.2.0b1/barewingui/__init__.py +114 -0
- barewingui-0.2.0b1/barewingui/_api.py +819 -0
- barewingui-0.2.0b1/barewingui/_dispatch.py +122 -0
- barewingui-0.2.0b1/barewingui/_font.py +56 -0
- barewingui-0.2.0b1/barewingui/_layout_core.py +266 -0
- barewingui-0.2.0b1/barewingui/app.py +325 -0
- barewingui-0.2.0b1/barewingui/constants.py +338 -0
- barewingui-0.2.0b1/barewingui/controls/__init__.py +34 -0
- barewingui-0.2.0b1/barewingui/controls/_base.py +237 -0
- barewingui-0.2.0b1/barewingui/controls/buttons.py +165 -0
- barewingui-0.2.0b1/barewingui/controls/group.py +92 -0
- barewingui-0.2.0b1/barewingui/controls/lists.py +263 -0
- barewingui-0.2.0b1/barewingui/controls/pickers.py +118 -0
- barewingui-0.2.0b1/barewingui/controls/range.py +265 -0
- barewingui-0.2.0b1/barewingui/controls/statusbar.py +109 -0
- barewingui-0.2.0b1/barewingui/controls/tabs.py +199 -0
- barewingui-0.2.0b1/barewingui/controls/text.py +119 -0
- barewingui-0.2.0b1/barewingui/controls/views.py +429 -0
- barewingui-0.2.0b1/barewingui/dialogs.py +312 -0
- barewingui-0.2.0b1/barewingui/dpi.py +47 -0
- barewingui-0.2.0b1/barewingui/errors.py +19 -0
- barewingui-0.2.0b1/barewingui/events.py +79 -0
- barewingui-0.2.0b1/barewingui/layout.py +293 -0
- barewingui-0.2.0b1/barewingui/menu.py +238 -0
- barewingui-0.2.0b1/barewingui/py.typed +0 -0
- barewingui-0.2.0b1/barewingui/shortcuts.py +102 -0
- barewingui-0.2.0b1/barewingui/timer.py +90 -0
- barewingui-0.2.0b1/barewingui/window.py +511 -0
- barewingui-0.2.0b1/pyproject.toml +42 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Bastian Flügel
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: barewingui
|
|
3
|
+
Version: 0.2.0b1
|
|
4
|
+
Summary: Pure GUI framework for native Windows apps in Python. No dependencies.
|
|
5
|
+
Keywords: win32,gui,desktop,native,ctypes,zero-dependency,windows
|
|
6
|
+
Author: Bastian Flügel
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
12
|
+
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
|
|
13
|
+
Classifier: Operating System :: Microsoft :: Windows :: Windows 11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
19
|
+
Classifier: Typing :: Typed
|
|
20
|
+
License-File: LICENSE.md
|
|
21
|
+
Project-URL: Homepage, https://bastian-fluegel.de
|
|
22
|
+
Project-URL: Issues, https://github.com/bastian-fluegel/barewingui/issues
|
|
23
|
+
Project-URL: Repository, https://github.com/bastian-fluegel/barewingui
|
|
24
|
+
|
|
25
|
+
<div align="center">
|
|
26
|
+
<a id="document-title"></a>
|
|
27
|
+
# BareWinGUI
|
|
28
|
+
|
|
29
|
+
**Pure GUI framework for native Windows apps in Python. No dependencies.**
|
|
30
|
+
|
|
31
|
+
[🇬🇧 English](#barewingui-en) • [🇩🇪 Deutsch](#barewingui-de)
|
|
32
|
+
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
<a id="barewingui-en"></a>
|
|
38
|
+
## 🇬🇧 BareWinGUI (English)
|
|
39
|
+
|
|
40
|
+
BareWinGUI is a pure GUI framework for Windows: native windows and controls from Python, with nothing but `ctypes` and the Windows system DLLs. It is the Python successor of the GUI part of AutoIt (`GUICreate`/`GUICtrlCreate`), with a Python-like API and a flexbox-style layout.
|
|
41
|
+
|
|
42
|
+
[Jump to German Version 🇩🇪](#barewingui-de)
|
|
43
|
+
|
|
44
|
+
### Key Features
|
|
45
|
+
|
|
46
|
+
* **No dependencies:** Python standard library only. No wheels, no runtimes.
|
|
47
|
+
* **Native controls only:** standard controls (`user32`) and common controls (`comctl32` v6), themed by Windows. BareWinGUI draws nothing itself: no owner-draw, no custom theme.
|
|
48
|
+
* **Flexbox-style layout:** `VBox`, `HBox`, `Stack`, `Spacer`, options `grow`, `shrink`, `width`, `height`, `min_*`, `max_*`, `align_self`. Built with `with` blocks.
|
|
49
|
+
* **High DPI:** Per-Monitor-V2, all sizes in DIPs, reacts to monitor changes.
|
|
50
|
+
* **Python-like API:** events are handlers without arguments (`on_click=...`, `button.on_click(fn)`), properties instead of getters and setters.
|
|
51
|
+
* **Thread-safe UI updates:** `app.invoke(fn)` and `app.call(fn)`.
|
|
52
|
+
* **Targets:** Windows 10 / 11, Python 3.11+, x64 and x86. The package imports on every platform; creating an `App` needs Windows.
|
|
53
|
+
|
|
54
|
+
### Installation
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install --pre barewingui # beta: pip needs --pre for pre-releases
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
or from source:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
git clone https://github.com/bastian-fluegel/barewingui.git
|
|
64
|
+
cd barewingui
|
|
65
|
+
pip install -e .
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Quickstart
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from barewingui import App, Button, Label, VBox, Window
|
|
72
|
+
|
|
73
|
+
app = App()
|
|
74
|
+
with Window("Hello", size=(320, 160)) as win:
|
|
75
|
+
with VBox(padding=16, gap=10):
|
|
76
|
+
label = Label("Hello, world!")
|
|
77
|
+
Button("Click me", on_click=lambda: setattr(label, "text", "Clicked!"))
|
|
78
|
+
app.run()
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### What is included
|
|
82
|
+
|
|
83
|
+
| Area | Classes and functions |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| Windows | `App`, `Window` (modal windows, shortcuts, `on_close`, `on_resize`) |
|
|
86
|
+
| Layout | `VBox`, `HBox`, `Stack`, `Spacer`, `Flex` |
|
|
87
|
+
| Standard controls | `Label`, `Button`, `CheckBox`, `RadioButton`, `TextBox`, `ComboBox`, `ListBox`, `GroupBox` |
|
|
88
|
+
| Common controls | `ProgressBar`, `Slider`, `SpinBox`, `StatusBar`, `DatePicker`, `TimePicker`, `ListView`, `TreeView`, `TabControl` / `TabPage` |
|
|
89
|
+
| Menus | `MenuBar`, `Menu`, `MenuItem`, `MenuSeparator`, `ContextMenu` (`context_menu=` on any control) |
|
|
90
|
+
| Dialogs | `message_box`, `ask_yes_no`, `show_info`, `show_error`, `input_box`, `open_file`, `save_file`, `pick_folder`, `choose_color`, `choose_font` |
|
|
91
|
+
| Other | `Timer`, `Event`, `Scale` |
|
|
92
|
+
|
|
93
|
+
### Examples
|
|
94
|
+
|
|
95
|
+
Run them with `python examples/<file>.py`:
|
|
96
|
+
|
|
97
|
+
* `01_form.py`: registration form with live validation
|
|
98
|
+
* `02_file_browser.py`: menu, `TreeView` (lazy loading), `ListView`, `StatusBar`
|
|
99
|
+
* `03_settings.py`: settings dialog with tabs, groups, slider, spin box
|
|
100
|
+
* `04_editor.py`: text editor with file dialogs and shortcuts
|
|
101
|
+
* `05_progress.py`: long task in a worker thread, reporting back with `app.invoke`
|
|
102
|
+
|
|
103
|
+
### Known Limits (Beta)
|
|
104
|
+
|
|
105
|
+
* Windows only, by design.
|
|
106
|
+
* Standard Windows controls only. Dark mode is not supported (classic controls have no documented dark mode); an experimental mode may follow later.
|
|
107
|
+
* No grid layout yet (`VBox`/`HBox`/`Stack` nest freely).
|
|
108
|
+
* No rich text, no custom-drawn controls, no images in controls yet.
|
|
109
|
+
* The API may still change before 1.0; unstable parts are marked in the docstrings.
|
|
110
|
+
* CI tests real windows on Windows (x64 and x86, Python 3.11 to 3.13) but cannot test mouse and keyboard behavior, native dialogs or multi-monitor DPI changes interactively. Reports from real machines are welcome.
|
|
111
|
+
|
|
112
|
+
### Tests
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
python -m unittest discover -s tests
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Logic tests (layout, scaling, shortcuts, dispatch) run everywhere; tests that create real windows run on Windows only and are skipped elsewhere. GitHub Actions runs both.
|
|
119
|
+
|
|
120
|
+
### Feedback
|
|
121
|
+
|
|
122
|
+
This is a beta. Please try it and tell me what is missing or broken: [report a bug or give feedback](https://github.com/bastian-fluegel/barewingui/issues/new/choose). Useful details: Windows version, display scaling, Python version, and a small script.
|
|
123
|
+
|
|
124
|
+
### License
|
|
125
|
+
|
|
126
|
+
Distributed under the MIT License. See [LICENSE.md](LICENSE.md) for details.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
<a id="barewingui-de"></a>
|
|
131
|
+
## 🇩🇪 BareWinGUI (Deutsch)
|
|
132
|
+
|
|
133
|
+
BareWinGUI ist ein reines GUI-Framework für Windows: native Fenster und Steuerelemente aus Python, nur mit `ctypes` und den Windows-Systembibliotheken. Es ist der Python-Nachfolger des GUI-Teils von AutoIt (`GUICreate`/`GUICtrlCreate`), mit Python-typischer API und Flexbox-artigem Layout.
|
|
134
|
+
|
|
135
|
+
[Switch to English Version 🇬🇧](#barewingui-en)
|
|
136
|
+
|
|
137
|
+
### Kernmerkmale
|
|
138
|
+
|
|
139
|
+
* **Keine Abhängigkeiten:** nur die Python-Standardbibliothek.
|
|
140
|
+
* **Nur native Steuerelemente:** Standard-Controls (`user32`) und Common Controls (`comctl32` v6), von Windows gestaltet. BareWinGUI zeichnet nichts selbst.
|
|
141
|
+
* **Flexbox-artiges Layout:** `VBox`, `HBox`, `Stack`, `Spacer` mit `grow`, `shrink`, `width`, `height`, `min_*`, `max_*`, `align_self`, aufgebaut mit `with`-Blöcken.
|
|
142
|
+
* **Hohe DPI:** Per-Monitor-V2, alle Größen in DIPs.
|
|
143
|
+
* **Pythonische API:** Ereignisse sind Handler ohne Argumente (`on_click=...`), Eigenschaften statt Getter/Setter.
|
|
144
|
+
* **Thread-sichere Aktualisierung:** `app.invoke(fn)` und `app.call(fn)`.
|
|
145
|
+
* **Ziele:** Windows 10 / 11, Python 3.11+, x64 und x86. Das Paket lässt sich überall importieren; eine `App` braucht Windows.
|
|
146
|
+
|
|
147
|
+
### Installation
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
pip install --pre barewingui # beta: pip needs --pre for pre-releases
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Schnellstart
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
from barewingui import App, Button, Label, VBox, Window
|
|
157
|
+
|
|
158
|
+
app = App()
|
|
159
|
+
with Window("Hello", size=(320, 160)) as win:
|
|
160
|
+
with VBox(padding=16, gap=10):
|
|
161
|
+
label = Label("Hello, world!")
|
|
162
|
+
Button("Click me", on_click=lambda: setattr(label, "text", "Clicked!"))
|
|
163
|
+
app.run()
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Beispiele
|
|
167
|
+
|
|
168
|
+
Start mit `python examples/<Datei>.py`: Formular mit Prüfung (`01_form.py`), Dateibrowser (`02_file_browser.py`), Einstellungsdialog (`03_settings.py`), Texteditor (`04_editor.py`), Fortschritt mit Arbeitsthread (`05_progress.py`).
|
|
169
|
+
|
|
170
|
+
### Bekannte Grenzen (Beta)
|
|
171
|
+
|
|
172
|
+
* Nur Windows, bewusst.
|
|
173
|
+
* Nur Standard-Windows-Controls; kein Dark Mode (später vielleicht experimentell).
|
|
174
|
+
* Noch kein Grid-Layout, kein Rich Text, keine eigengezeichneten Controls.
|
|
175
|
+
* Die API kann sich vor 1.0 noch ändern.
|
|
176
|
+
* Die CI testet echte Fenster unter Windows (x64 und x86, Python 3.11 bis 3.13), aber keine Maus-/Tastaturbedienung, nativen Dialoge oder DPI-Wechsel zwischen Monitoren. Rückmeldungen von echten Rechnern sind willkommen.
|
|
177
|
+
|
|
178
|
+
### Tests
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
python -m unittest discover -s tests
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Rückmeldung
|
|
185
|
+
|
|
186
|
+
Das ist eine Beta. Probier es aus und sag mir, was fehlt oder kaputt ist: [Fehler melden oder Rückmeldung geben](https://github.com/bastian-fluegel/barewingui/issues/new/choose). Hilfreich: Windows-Version, Skalierung, Python-Version und ein kleines Skript.
|
|
187
|
+
|
|
188
|
+
### Lizenz
|
|
189
|
+
|
|
190
|
+
MIT-Lizenz, siehe [LICENSE.md](LICENSE.md).
|
|
191
|
+
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a id="document-title"></a>
|
|
3
|
+
# BareWinGUI
|
|
4
|
+
|
|
5
|
+
**Pure GUI framework for native Windows apps in Python. No dependencies.**
|
|
6
|
+
|
|
7
|
+
[🇬🇧 English](#barewingui-en) • [🇩🇪 Deutsch](#barewingui-de)
|
|
8
|
+
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<a id="barewingui-en"></a>
|
|
14
|
+
## 🇬🇧 BareWinGUI (English)
|
|
15
|
+
|
|
16
|
+
BareWinGUI is a pure GUI framework for Windows: native windows and controls from Python, with nothing but `ctypes` and the Windows system DLLs. It is the Python successor of the GUI part of AutoIt (`GUICreate`/`GUICtrlCreate`), with a Python-like API and a flexbox-style layout.
|
|
17
|
+
|
|
18
|
+
[Jump to German Version 🇩🇪](#barewingui-de)
|
|
19
|
+
|
|
20
|
+
### Key Features
|
|
21
|
+
|
|
22
|
+
* **No dependencies:** Python standard library only. No wheels, no runtimes.
|
|
23
|
+
* **Native controls only:** standard controls (`user32`) and common controls (`comctl32` v6), themed by Windows. BareWinGUI draws nothing itself: no owner-draw, no custom theme.
|
|
24
|
+
* **Flexbox-style layout:** `VBox`, `HBox`, `Stack`, `Spacer`, options `grow`, `shrink`, `width`, `height`, `min_*`, `max_*`, `align_self`. Built with `with` blocks.
|
|
25
|
+
* **High DPI:** Per-Monitor-V2, all sizes in DIPs, reacts to monitor changes.
|
|
26
|
+
* **Python-like API:** events are handlers without arguments (`on_click=...`, `button.on_click(fn)`), properties instead of getters and setters.
|
|
27
|
+
* **Thread-safe UI updates:** `app.invoke(fn)` and `app.call(fn)`.
|
|
28
|
+
* **Targets:** Windows 10 / 11, Python 3.11+, x64 and x86. The package imports on every platform; creating an `App` needs Windows.
|
|
29
|
+
|
|
30
|
+
### Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install --pre barewingui # beta: pip needs --pre for pre-releases
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
or from source:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
git clone https://github.com/bastian-fluegel/barewingui.git
|
|
40
|
+
cd barewingui
|
|
41
|
+
pip install -e .
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Quickstart
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
from barewingui import App, Button, Label, VBox, Window
|
|
48
|
+
|
|
49
|
+
app = App()
|
|
50
|
+
with Window("Hello", size=(320, 160)) as win:
|
|
51
|
+
with VBox(padding=16, gap=10):
|
|
52
|
+
label = Label("Hello, world!")
|
|
53
|
+
Button("Click me", on_click=lambda: setattr(label, "text", "Clicked!"))
|
|
54
|
+
app.run()
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### What is included
|
|
58
|
+
|
|
59
|
+
| Area | Classes and functions |
|
|
60
|
+
| --- | --- |
|
|
61
|
+
| Windows | `App`, `Window` (modal windows, shortcuts, `on_close`, `on_resize`) |
|
|
62
|
+
| Layout | `VBox`, `HBox`, `Stack`, `Spacer`, `Flex` |
|
|
63
|
+
| Standard controls | `Label`, `Button`, `CheckBox`, `RadioButton`, `TextBox`, `ComboBox`, `ListBox`, `GroupBox` |
|
|
64
|
+
| Common controls | `ProgressBar`, `Slider`, `SpinBox`, `StatusBar`, `DatePicker`, `TimePicker`, `ListView`, `TreeView`, `TabControl` / `TabPage` |
|
|
65
|
+
| Menus | `MenuBar`, `Menu`, `MenuItem`, `MenuSeparator`, `ContextMenu` (`context_menu=` on any control) |
|
|
66
|
+
| Dialogs | `message_box`, `ask_yes_no`, `show_info`, `show_error`, `input_box`, `open_file`, `save_file`, `pick_folder`, `choose_color`, `choose_font` |
|
|
67
|
+
| Other | `Timer`, `Event`, `Scale` |
|
|
68
|
+
|
|
69
|
+
### Examples
|
|
70
|
+
|
|
71
|
+
Run them with `python examples/<file>.py`:
|
|
72
|
+
|
|
73
|
+
* `01_form.py`: registration form with live validation
|
|
74
|
+
* `02_file_browser.py`: menu, `TreeView` (lazy loading), `ListView`, `StatusBar`
|
|
75
|
+
* `03_settings.py`: settings dialog with tabs, groups, slider, spin box
|
|
76
|
+
* `04_editor.py`: text editor with file dialogs and shortcuts
|
|
77
|
+
* `05_progress.py`: long task in a worker thread, reporting back with `app.invoke`
|
|
78
|
+
|
|
79
|
+
### Known Limits (Beta)
|
|
80
|
+
|
|
81
|
+
* Windows only, by design.
|
|
82
|
+
* Standard Windows controls only. Dark mode is not supported (classic controls have no documented dark mode); an experimental mode may follow later.
|
|
83
|
+
* No grid layout yet (`VBox`/`HBox`/`Stack` nest freely).
|
|
84
|
+
* No rich text, no custom-drawn controls, no images in controls yet.
|
|
85
|
+
* The API may still change before 1.0; unstable parts are marked in the docstrings.
|
|
86
|
+
* CI tests real windows on Windows (x64 and x86, Python 3.11 to 3.13) but cannot test mouse and keyboard behavior, native dialogs or multi-monitor DPI changes interactively. Reports from real machines are welcome.
|
|
87
|
+
|
|
88
|
+
### Tests
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
python -m unittest discover -s tests
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Logic tests (layout, scaling, shortcuts, dispatch) run everywhere; tests that create real windows run on Windows only and are skipped elsewhere. GitHub Actions runs both.
|
|
95
|
+
|
|
96
|
+
### Feedback
|
|
97
|
+
|
|
98
|
+
This is a beta. Please try it and tell me what is missing or broken: [report a bug or give feedback](https://github.com/bastian-fluegel/barewingui/issues/new/choose). Useful details: Windows version, display scaling, Python version, and a small script.
|
|
99
|
+
|
|
100
|
+
### License
|
|
101
|
+
|
|
102
|
+
Distributed under the MIT License. See [LICENSE.md](LICENSE.md) for details.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
<a id="barewingui-de"></a>
|
|
107
|
+
## 🇩🇪 BareWinGUI (Deutsch)
|
|
108
|
+
|
|
109
|
+
BareWinGUI ist ein reines GUI-Framework für Windows: native Fenster und Steuerelemente aus Python, nur mit `ctypes` und den Windows-Systembibliotheken. Es ist der Python-Nachfolger des GUI-Teils von AutoIt (`GUICreate`/`GUICtrlCreate`), mit Python-typischer API und Flexbox-artigem Layout.
|
|
110
|
+
|
|
111
|
+
[Switch to English Version 🇬🇧](#barewingui-en)
|
|
112
|
+
|
|
113
|
+
### Kernmerkmale
|
|
114
|
+
|
|
115
|
+
* **Keine Abhängigkeiten:** nur die Python-Standardbibliothek.
|
|
116
|
+
* **Nur native Steuerelemente:** Standard-Controls (`user32`) und Common Controls (`comctl32` v6), von Windows gestaltet. BareWinGUI zeichnet nichts selbst.
|
|
117
|
+
* **Flexbox-artiges Layout:** `VBox`, `HBox`, `Stack`, `Spacer` mit `grow`, `shrink`, `width`, `height`, `min_*`, `max_*`, `align_self`, aufgebaut mit `with`-Blöcken.
|
|
118
|
+
* **Hohe DPI:** Per-Monitor-V2, alle Größen in DIPs.
|
|
119
|
+
* **Pythonische API:** Ereignisse sind Handler ohne Argumente (`on_click=...`), Eigenschaften statt Getter/Setter.
|
|
120
|
+
* **Thread-sichere Aktualisierung:** `app.invoke(fn)` und `app.call(fn)`.
|
|
121
|
+
* **Ziele:** Windows 10 / 11, Python 3.11+, x64 und x86. Das Paket lässt sich überall importieren; eine `App` braucht Windows.
|
|
122
|
+
|
|
123
|
+
### Installation
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
pip install --pre barewingui # beta: pip needs --pre for pre-releases
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Schnellstart
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
from barewingui import App, Button, Label, VBox, Window
|
|
133
|
+
|
|
134
|
+
app = App()
|
|
135
|
+
with Window("Hello", size=(320, 160)) as win:
|
|
136
|
+
with VBox(padding=16, gap=10):
|
|
137
|
+
label = Label("Hello, world!")
|
|
138
|
+
Button("Click me", on_click=lambda: setattr(label, "text", "Clicked!"))
|
|
139
|
+
app.run()
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Beispiele
|
|
143
|
+
|
|
144
|
+
Start mit `python examples/<Datei>.py`: Formular mit Prüfung (`01_form.py`), Dateibrowser (`02_file_browser.py`), Einstellungsdialog (`03_settings.py`), Texteditor (`04_editor.py`), Fortschritt mit Arbeitsthread (`05_progress.py`).
|
|
145
|
+
|
|
146
|
+
### Bekannte Grenzen (Beta)
|
|
147
|
+
|
|
148
|
+
* Nur Windows, bewusst.
|
|
149
|
+
* Nur Standard-Windows-Controls; kein Dark Mode (später vielleicht experimentell).
|
|
150
|
+
* Noch kein Grid-Layout, kein Rich Text, keine eigengezeichneten Controls.
|
|
151
|
+
* Die API kann sich vor 1.0 noch ändern.
|
|
152
|
+
* Die CI testet echte Fenster unter Windows (x64 und x86, Python 3.11 bis 3.13), aber keine Maus-/Tastaturbedienung, nativen Dialoge oder DPI-Wechsel zwischen Monitoren. Rückmeldungen von echten Rechnern sind willkommen.
|
|
153
|
+
|
|
154
|
+
### Tests
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
python -m unittest discover -s tests
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Rückmeldung
|
|
161
|
+
|
|
162
|
+
Das ist eine Beta. Probier es aus und sag mir, was fehlt oder kaputt ist: [Fehler melden oder Rückmeldung geben](https://github.com/bastian-fluegel/barewingui/issues/new/choose). Hilfreich: Windows-Version, Skalierung, Python-Version und ein kleines Skript.
|
|
163
|
+
|
|
164
|
+
### Lizenz
|
|
165
|
+
|
|
166
|
+
MIT-Lizenz, siehe [LICENSE.md](LICENSE.md).
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"""
|
|
2
|
+
barewingui
|
|
3
|
+
~~~~~~~~~~
|
|
4
|
+
Native Windows GUIs for Python: real Win32 controls, flexbox-style layout, no dependencies.
|
|
5
|
+
|
|
6
|
+
Beta (0.2.0b1). Importable everywhere; creating an App needs Windows.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
from barewingui.app import App
|
|
12
|
+
from barewingui.dpi import Scale
|
|
13
|
+
from barewingui.controls import (
|
|
14
|
+
Button,
|
|
15
|
+
CheckBox,
|
|
16
|
+
ComboBox,
|
|
17
|
+
DatePicker,
|
|
18
|
+
GroupBox,
|
|
19
|
+
Label,
|
|
20
|
+
ListBox,
|
|
21
|
+
ListView,
|
|
22
|
+
ProgressBar,
|
|
23
|
+
RadioButton,
|
|
24
|
+
Slider,
|
|
25
|
+
SpinBox,
|
|
26
|
+
StatusBar,
|
|
27
|
+
TabControl,
|
|
28
|
+
TabPage,
|
|
29
|
+
TextBox,
|
|
30
|
+
TextInput,
|
|
31
|
+
TimePicker,
|
|
32
|
+
TreeNode,
|
|
33
|
+
TreeView,
|
|
34
|
+
)
|
|
35
|
+
from barewingui.dialogs import (
|
|
36
|
+
FontChoice,
|
|
37
|
+
ask_ok_cancel,
|
|
38
|
+
ask_yes_no,
|
|
39
|
+
choose_color,
|
|
40
|
+
choose_font,
|
|
41
|
+
input_box,
|
|
42
|
+
message_box,
|
|
43
|
+
open_file,
|
|
44
|
+
pick_folder,
|
|
45
|
+
save_file,
|
|
46
|
+
show_error,
|
|
47
|
+
show_info,
|
|
48
|
+
show_warning,
|
|
49
|
+
)
|
|
50
|
+
from barewingui.errors import BareWinGUIError, LayoutError, PlatformError
|
|
51
|
+
from barewingui.events import Event
|
|
52
|
+
from barewingui.menu import ContextMenu, Menu, MenuBar, MenuItem, MenuSeparator
|
|
53
|
+
from barewingui.layout import Flex, HBox, Rect, Size, Spacer, Stack, VBox
|
|
54
|
+
from barewingui.timer import Timer
|
|
55
|
+
from barewingui.window import Window
|
|
56
|
+
|
|
57
|
+
__version__ = "0.2.0b1"
|
|
58
|
+
|
|
59
|
+
__all__ = [
|
|
60
|
+
"App",
|
|
61
|
+
"FontChoice",
|
|
62
|
+
"ask_ok_cancel",
|
|
63
|
+
"ask_yes_no",
|
|
64
|
+
"choose_color",
|
|
65
|
+
"choose_font",
|
|
66
|
+
"input_box",
|
|
67
|
+
"message_box",
|
|
68
|
+
"open_file",
|
|
69
|
+
"pick_folder",
|
|
70
|
+
"save_file",
|
|
71
|
+
"show_error",
|
|
72
|
+
"show_info",
|
|
73
|
+
"show_warning",
|
|
74
|
+
"ContextMenu",
|
|
75
|
+
"Menu",
|
|
76
|
+
"MenuBar",
|
|
77
|
+
"MenuItem",
|
|
78
|
+
"MenuSeparator",
|
|
79
|
+
"Timer",
|
|
80
|
+
"BareWinGUIError",
|
|
81
|
+
"Button",
|
|
82
|
+
"CheckBox",
|
|
83
|
+
"ComboBox",
|
|
84
|
+
"DatePicker",
|
|
85
|
+
"Event",
|
|
86
|
+
"GroupBox",
|
|
87
|
+
"Label",
|
|
88
|
+
"ListBox",
|
|
89
|
+
"ListView",
|
|
90
|
+
"ProgressBar",
|
|
91
|
+
"RadioButton",
|
|
92
|
+
"Slider",
|
|
93
|
+
"SpinBox",
|
|
94
|
+
"StatusBar",
|
|
95
|
+
"TabControl",
|
|
96
|
+
"TabPage",
|
|
97
|
+
"TextBox",
|
|
98
|
+
"TextInput",
|
|
99
|
+
"TimePicker",
|
|
100
|
+
"TreeNode",
|
|
101
|
+
"TreeView",
|
|
102
|
+
"Flex",
|
|
103
|
+
"HBox",
|
|
104
|
+
"LayoutError",
|
|
105
|
+
"PlatformError",
|
|
106
|
+
"Rect",
|
|
107
|
+
"Scale",
|
|
108
|
+
"Size",
|
|
109
|
+
"Spacer",
|
|
110
|
+
"Stack",
|
|
111
|
+
"VBox",
|
|
112
|
+
"Window",
|
|
113
|
+
"__version__",
|
|
114
|
+
]
|