aio_wx_widgets
Project description
aio_wx_widgets
Wx python app structure using MVC model. Work in progress, adding widgets when I need them. See the demo folder for usage.
Features:
- Add widgets using context managers.
- Two-way or one-way Property binding from controller properties to the view.
- Proper Margins and alignment of items
The example below is a bit outdated, but gives a rough idea. Please see the demo for more.
```python
# Use a context manager for container types like a group or grid.
# A group is a container with a label and a sizer inside. Inside
# this sizer widgets, or other containers can be placed.
with self.add(Group("A labelled container.")) as group:
group.add(Text(text="A horizontal grid."))
with group.add(Grid()) as grd:
# the binding binds to an attribute defined in the controller
# the weight determines how much space a specific item should consume
# with respect to the other members of the container.
grd.add(IntEntry(binding=self.bind("value_1")), weight=6, margin=3)
grd.add(IntEntry(binding=self.bind("value_1")), weight=4, margin=3)
grd.add(IntEntry(binding=self.bind("value_1")), weight=4, margin=3)
```
```python
vert_grid.add(
Text(text="Center aligned text with a large margin."),
margin=(10, 10, 30, 5), # (left,right,top,below)
align_horizontal=AlignHorizontal.center,)
```
Installation
- Create a virtual env, activate it and
pip install aio_wx_widgets
Running the demo
- Install the libary as described above.
- clone the repo.
- from the activated virtualenv:
python -m demo
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aio_wx_widgets-1.3.6.tar.gz
(82.6 kB
view details)
Built Distribution
File details
Details for the file aio_wx_widgets-1.3.6.tar.gz
.
File metadata
- Download URL: aio_wx_widgets-1.3.6.tar.gz
- Upload date:
- Size: 82.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.24.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1aed8f2af2f8f09208c3930bfeb2543e06f4d1e09516a567ba15f693b90f95de |
|
MD5 | d1ef0005f5964e5041e347f6ea90a1f1 |
|
BLAKE2b-256 | 3db48a2c750e2963f3f987ba999d99ca6ee6af132a5df27b279885af8bca333a |
File details
Details for the file aio_wx_widgets-1.3.6-py3-none-any.whl
.
File metadata
- Download URL: aio_wx_widgets-1.3.6-py3-none-any.whl
- Upload date:
- Size: 26.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.24.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f83b171a054bf344a42ec2b38d9d43d2cee0323ad7bdf688f9ad802cd0ca81d |
|
MD5 | 89ce16e930de1005f2f0a4165adbce94 |
|
BLAKE2b-256 | 195d1597c207bcc2a469efb70129356df52d6defe007fdff602cfc8d3f9818f3 |