Bindings for Iced, a cross-platform GUI library focused on simplicity. Inspired by Elm.
Project description
Python bindings for Iced.
Iced is a cross-platform GUI library focused on simplicity and type-safety. Inspired by Elm.
Installation
Precompiled wheel:
$ pip install pyiced
From source:
$ pip install .
To install from source you need to have a recent version of Rust installed in your $PATH.
Rustup is probably the most easy to use option to install and update Rust on your system.
Quick Example
from pyiced import (
Align, button, ButtonState, column, container, IcedApp, Length, text,
)
class ExampleApp(IcedApp):
def __init__(self):
self.__incr_button_state = ButtonState()
self.__decr_button_state = ButtonState()
self.__value = 0
def title(self):
return 'Counter'
def view(self):
increment_button = button(
self.__incr_button_state, # To track the state across redraws.
text('Increment'), # This is content on the button.
on_press='incr', # This value is received in update().
)
value_label = text(f'{self.__value}', size=50)
decrement_button = button(
self.__decr_button_state,
text('Decrement'),
on_press='decr',
)
return container(
column(
[increment_button, value_label, decrement_button],
align_items=Align.CENTER,
),
padding=20, align_x=Align.CENTER, align_y=Align.CENTER,
width=Length.FILL, height=Length.FILL,
)
def update(self, msg, clipboard):
# When an event occurs, this method is called.
# It can optionally return a list of async functions,
# to handle the event.
match msg:
case 'incr':
self.__value += 1
case 'decr':
self.__value -= 1
if __name__ == '__main__':
# This function only returns if there is an error on start-up.
# Otherwise the program gets terminated when the window is closed.
ExampleApp().run()
Bigger Example
Please find the source code in examples/chess.py.
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
pyiced-0.3.0a4.tar.gz
(66.7 kB
view hashes)
Built Distributions
Close
Hashes for pyiced-0.3.0a4-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 151a7c52d6cc7e56b608f329d68d634fd70cea92fc99ee383736da4270bcd328 |
|
MD5 | 048673ecf0d0556c2a146a67cae842d6 |
|
BLAKE2b-256 | 9dc1a0d216113a5c33a9a2c37d4e8b301097d6c01415078bfe2205c050716251 |
Close
Hashes for pyiced-0.3.0a4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67d0baf4e6abede04f815cdfcff40f36d748ae76d392ae55363129715eefb50c |
|
MD5 | 8dfbe74bf50ddb50e3e78a636ad31c52 |
|
BLAKE2b-256 | 50971787a361e0ea38dee156cabff4aabe696810d8ab0e65a3b84e474762bda7 |
Close
Hashes for pyiced-0.3.0a4-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bdd3f903a9c8ecd98bd77521e65e0203e606b073bb11df22c066ddb4418ab5c |
|
MD5 | d1919c4fd5dac9fd74a41a6f057a37d0 |
|
BLAKE2b-256 | ee13a00ba114130f2cc157b6a0e5bd2fa1759db359e20c1f9c800582ec17a19c |
Close
Hashes for pyiced-0.3.0a4-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6abb3c51280902d251d1793a2e6371fb5ef3e76df933cfa3163521ac1d167978 |
|
MD5 | 6dca8da93db841bc3dc16e14d279dbd7 |
|
BLAKE2b-256 | de52329d66263b6a22fb9d88ba874459d40bcb5d21cb173ac11f93c97ef88454 |
Close
Hashes for pyiced-0.3.0a4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c7e5715bfbc8818aca84c1be3fc0146faf1724df9c8c0f18629e9d387ae6946 |
|
MD5 | 6ebed69e5521bd95e459986952930a1f |
|
BLAKE2b-256 | f27eecc50ba168d9287aa3f2c31d3f0ecf6d1a332bfa4d6665c63a104c7e790c |
Close
Hashes for pyiced-0.3.0a4-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 175ba08128a5eef9e06e0248989eadebd01df16ec5496e48cd6eb1bec6179e49 |
|
MD5 | c024dcd32437ebe2599670184cc7b3ab |
|
BLAKE2b-256 | 368af6b7d83bf6c5601bf6c2c7481178f8e8cabbef2d7c1e0bb35dfdf1d3c6cc |
Close
Hashes for pyiced-0.3.0a4-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5346418886e1ce6771e2a47d1e58cd5af67bc49dc20c9bb8b01cf778b0a474a |
|
MD5 | dc31e3f8f08193f3413116816a584ff4 |
|
BLAKE2b-256 | 7a0b778e869ca6f1cbe28f922f2c60a28af7bc8788ddb76a27fa9926b921f087 |
Close
Hashes for pyiced-0.3.0a4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2153e96652d72b68e2b110badeb5aff55d25eb692d7776cccc89a80f0e582e2 |
|
MD5 | b4d08a8d9c89e3fd7e9ee4084a37cd93 |
|
BLAKE2b-256 | c40cdff8a4ba5341c96f7a858bdc6b062b948d78635de5108bfb3f8913dfe6fd |
Close
Hashes for pyiced-0.3.0a4-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6435c2fd3105cf2ae8da4c44a554b7adfdfc7634c641fec7b80adc190b087aa4 |
|
MD5 | 95b968f774fc3efb394ac54499dfd0db |
|
BLAKE2b-256 | 216715878038009c39a7f914d138713a771f0d6b346e9374b404dbdd645818a9 |
Close
Hashes for pyiced-0.3.0a4-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b75707b8f6b4028b4b46309b16b00dd3936f49c06f89bddc0f5ca7e37d91d4c6 |
|
MD5 | accb09474d45b8ca73f0f8b590889226 |
|
BLAKE2b-256 | 575629a166726df35e2745a4c79fee4cd5cb42b911972e717e788d1827e10c68 |
Close
Hashes for pyiced-0.3.0a4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df0ef6dc929af6ee8a97e92606319ad8d547b36d51b93cba715b643e501876bf |
|
MD5 | a2d7401eae8817fc4a08767e3dde0d34 |
|
BLAKE2b-256 | 644a0f34e5a2b1ca663e3957327dbf01760ae9e2095ab467a80a16bd2edccb76 |
Close
Hashes for pyiced-0.3.0a4-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b95528f28d261ebd3ee9f1bb012aab93a8196a048f037b30a4b5757f0759fc1a |
|
MD5 | a31cda9299df13fb4c2fc0ce100bf96e |
|
BLAKE2b-256 | e4d8475f2e545fef7e3479356af79c8696e7ebba0bb1834efa80c5051bea345b |