You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lightweight, expressive GUI framework for compatible terminals
@@ -39,7 +39,7 @@ With zero external dependencies, and features including keyboard and mouse input
39
39
<!-- GETTING STARTED -->
40
40
## Getting Started
41
41
42
-
XtermGUI is available on [PyPI](https://pypi.org/), under the name `XtermGUI` To use it in your project, run:
42
+
XtermGUI is available on [PyPI](https://pypi.org/project/XtermGUI/). To use it in your project, run:
43
43
44
44
```
45
45
pip install XtermGUI
@@ -71,7 +71,7 @@ This framework has been tested using the default setup for [WSL 2](https://learn
71
71
72
72
Use the `console_inputs` context manager to prepare the terminal for use with XtermGUI. This will handle the cleanup automatically.
73
73
```py
74
-
fromXtermGUIimport console_inputs
74
+
fromxtermguiimport console_inputs
75
75
76
76
77
77
with console_inputs():
@@ -83,7 +83,7 @@ _Please note that there may sometimes be control sequence leakage when exiting y
83
83
84
84
Use the `read_console` function to read both keyboard and mouse input from the console. View the [API summary](#api-summary) or [documentation](https://github.com/Kieran-Lock/XtermGUI/blob/main/DOCUMENTATION.md) for the possible events you can receieve from this function.
85
85
```py
86
-
fromXtermGUIimport console_inputs, read_console
86
+
fromxtermguiimport console_inputs, read_console
87
87
88
88
89
89
with console_inputs():
@@ -93,7 +93,7 @@ with console_inputs():
93
93
94
94
Read repeated console input by placing this function in a loop. This can be useful for reading a stream of user inputs.
95
95
```py
96
-
fromXtermGUIimport console_inputs, read_console
96
+
fromxtermguiimport console_inputs, read_console
97
97
98
98
99
99
with console_inputs():
@@ -106,14 +106,14 @@ with console_inputs():
106
106
107
107
The `Text` class can be used to represent formatted text, which can be printed to the console. It provides all the same functionality as the built-in `str` string type, but can be used in conjunction with the `Style` and `Colour` classes to represent coloured and styled text.
Colour.configure_default_background(RGBs.DEFAULT_BACKGROUND_WSL.value) # Test written in WSL, so the background is configured like so
113
113
114
114
115
115
text ="This is styled text."
116
-
text_colour = Colours.F_BLUE.blend(Colours.F_GREY.value, foreground_bias=0.5, foreground_gamma=2.2) # This blending just uses the default blending parameters
116
+
text_colour = Colours.F_BLUE.value.blend(Colours.F_GREY.value, foreground_bias=0.5, foreground_gamma=2.2) # This blending just uses the default blending parameters
INTERACTION_REGION= Region(Coordinate(0, 0), Coordinate(20, 0), Coordinate(20, 10), Coordinate(0, 10)) # An example region - a 20x10 rectangle, which forms a square in the terminal
@@ -231,7 +231,7 @@ Mouse interactions require an `Event`, and take a `Region` as an optional argume
231
231
232
232
The `GUI` class provides three key I/O methods - `print`, `erase`, and `clear` - each of which are show below.
233
233
```py
234
-
fromXtermGUIimportGUI, Coordinate
234
+
fromxtermguiimportGUI, Coordinate
235
235
236
236
237
237
classMyGUI(GUI):
@@ -258,7 +258,7 @@ if __name__ == "__main__":
258
258
259
259
To manage GUI layers in your application, use the `LayeredGUI` class. This will provide all of the same I/O methods as the simple `GUI` class, but manages layers automatically.
0 commit comments