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.components 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
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.2.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for console_gui-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94a22330e102e5a51d949dbfb7b56330b5449b083d403af082f004648897d8f7 |
|
MD5 | 63e7040b01ec452d7f4e99b5b32371e5 |
|
BLAKE2b-256 | 760e174471e9acf2da59f9263f3b76e43411124df019a467e672c433eba05710 |