-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
28 lines (19 loc) · 911 Bytes
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from textual.app import App, ComposeResult
from textual.widgets import Button, Input, RadioButton, Switch
from hoptex import hoptex
from hoptex.configs import HoptexBindingConfig, HoptexWidgetsFiltersConfig, Static
class NotFocusableButton(Button):
...
widgets_filters = HoptexWidgetsFiltersConfig(block_list=[NotFocusableButton])
bindings = HoptexBindingConfig(press="ctrl+g", press_conf={"description": "Another description"})
@hoptex(widgets_filters=widgets_filters, bindings=bindings)
class DemoAppMy(App):
def compose(self) -> ComposeResult:
yield Input("One", classes="box")
yield Button("Button", classes="box")
yield Static("Static", classes="box")
yield Switch(True, classes="box")
yield RadioButton("Radio Button", classes="box")
yield NotFocusableButton("Not Focusable", classes="box")
if __name__ == "__main__":
DemoAppMy().run()