mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Rebuild the FAQ
Keep forgetting to do this!
This commit is contained in:
18
FAQ.md
18
FAQ.md
@@ -105,23 +105,15 @@ If you want them more like this:
|
|||||||
+---------------+
|
+---------------+
|
||||||
```
|
```
|
||||||
|
|
||||||
the best approach is to wrap each widget in a container that individually
|
the best approach is to wrap each widget in a [`Center`
|
||||||
centers it. For example:
|
container](https://textual.textualize.io/api/containers/#textual.containers.Center)
|
||||||
|
that individually centers it. For example:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from textual.app import App, ComposeResult
|
from textual.app import App, ComposeResult
|
||||||
from textual.containers import Container
|
from textual.containers import Center
|
||||||
from textual.widgets import Button
|
from textual.widgets import Button
|
||||||
|
|
||||||
class Center( Container ):
|
|
||||||
DEFAULT_CSS = """
|
|
||||||
Center {
|
|
||||||
height: auto;
|
|
||||||
width: 100%;
|
|
||||||
align: center middle;
|
|
||||||
}
|
|
||||||
"""
|
|
||||||
|
|
||||||
class ButtonApp(App):
|
class ButtonApp(App):
|
||||||
|
|
||||||
CSS = """
|
CSS = """
|
||||||
@@ -182,7 +174,7 @@ terminal application. Which keys get passed on can differ from terminal to
|
|||||||
terminal, and from operating system to operating system.
|
terminal, and from operating system to operating system.
|
||||||
|
|
||||||
Because of this it's best to stick to key combinations that are known to be
|
Because of this it's best to stick to key combinations that are known to be
|
||||||
universally-supported; these include:
|
universally-supported; these include the likes of:
|
||||||
|
|
||||||
- Letters
|
- Letters
|
||||||
- Numbers
|
- Numbers
|
||||||
|
|||||||
Reference in New Issue
Block a user