We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd93bb7 commit a5035acCopy full SHA for a5035ac
examples/open_link.py
@@ -4,12 +4,15 @@
4
5
6
class OpenLink(App[None]):
7
+ """Demonstrates opening a URL in the same tab or a new tab."""
8
+
9
def compose(self) -> ComposeResult:
10
yield Button("Visit the Textual docs", id="open-link-same-tab")
11
yield Button("Visit the Textual docs in a new tab", id="open-link-new-tab")
12
13
@on(Button.Pressed)
14
def open_link(self, event: Button.Pressed) -> None:
15
+ """Open the URL in the same tab or a new tab depending on which button was pressed."""
16
self.open_url(
17
"https://textual.textualize.io",
18
new_tab=event.button.id == "open-link-new-tab",
0 commit comments