1
0
Fork 0

Adding upstream version 4.0.4.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-04 22:09:41 +02:00
parent 1f832614e9
commit 0832c185c0
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
48 changed files with 7595 additions and 0 deletions

View file

@ -0,0 +1,35 @@
"""Basic dropdown autocomplete from a list of options."""
from textual.app import App, ComposeResult
from textual.containers import Container
from textual.widgets import Input
from textual_autocomplete import AutoComplete
LANGUAGES = [
"Python",
"JavaScript",
"TypeScript",
"Java",
"C++",
"Ruby",
"Go",
"Rust",
]
class AutoCompleteExample(App[None]):
def compose(self) -> ComposeResult:
with Container(id="container"):
text_input = Input(placeholder="Search for a programming language...")
yield text_input
yield AutoComplete(
target=text_input, # The widget to attach autocomplete to
candidates=LANGUAGES, # The list of completion candidates
)
if __name__ == "__main__":
app = AutoCompleteExample()
app.run()