gui for conosle buttons and fields
Project description
console-gui
1 - install: pip install console-gui
2 - use from gui import *
# when we change the text
# component = what is the component calling the func
def on_text_change(component):
reader.components['readonly'].config(text=component.text)
componets=[
Field('readonly', None, readonly=True, text='hello readonly'), # readonly lets the user not click on it
Field('this is a input filid', on_text_change),
Button('this is a disable button', None, enable=False), # gray out the button not letting the user click it
Button('this is a exit button', lambda _: exit(0)) # exit the prorgam when click
]
reader = Reader(componets)
reader.read()
3 - add more from gui import Component
class MyComponent(Component):
def __init__(self, name, click, **kwargs):
super().__init__(name, click, **kwargs)
self.text = name
# calls when we click
def on_click(self):
self.text = 'pizza'
self.click(self)
# what will is show
def __str__(self):
return self.text
4 - help
class Component:
def __init__(name, click, kwargs)
name is not the thing that will display unless text is none
name is the str use to get Comp ex: reader.components.get('button')
for Button name use conent
Reader.__init__(the list of componets,
stop if press type x = None by defalt,
the button color when selected=WHITE by defalt,
the button fore color when selected=BLACK bu defalt)
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
console-gui-0.0.5.tar.gz
(4.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file console-gui-0.0.5.tar.gz.
File metadata
- Download URL: console-gui-0.0.5.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef30da9913aab42eece4d44eeab42a27d617825a621acc8d5c9ad9bf8891320c
|
|
| MD5 |
f56855e269ffc3b64bbbdc1856c9409f
|
|
| BLAKE2b-256 |
eceab1b7705737cb2b13ef5a95ce8fba3d5d626455c0936b69bbe925a1110719
|
File details
Details for the file console_gui-0.0.5-py3-none-any.whl.
File metadata
- Download URL: console_gui-0.0.5-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d60bad76c06893db645990c5bcabf96e51427d2ddd68144c64662a5c5246dfad
|
|
| MD5 |
aef915d3e560ee92b5bfa31081d46470
|
|
| BLAKE2b-256 |
ee6f39f66b758c67e31135d40b5102e446ee88825f08aff578ce13bed24b82d6
|