From 8ae642bf8cca08ccb9868a9e6476de6006b52d43 Mon Sep 17 00:00:00 2001 From: laffra Date: Sun, 10 Dec 2023 10:45:03 +0100 Subject: [PATCH] Add explanation --- examples/dom.py | 13 +++++++++++++ ltk/widgets.py | 1 + 2 files changed, 14 insertions(+) diff --git a/examples/dom.py b/examples/dom.py index 7a610c3..67557c3 100644 --- a/examples/dom.py +++ b/examples/dom.py @@ -74,6 +74,9 @@ def color(event): border-radius: 11px; padding: 14px; } + #dom-demo .ltk-a { + margin-right: 5px; + } #dom-texts .ltk-text { margin: 5px; } @@ -89,6 +92,16 @@ def color(event): return ( ltk.VBox( ltk.Heading1("Dynamic DOM Operations"), + ltk.Text("We're using the following jQuery APIs: ", + ltk.Link("https://api.jquery.com/append", "append"), + ltk.Link("https://api.jquery.com/appendTo", "appendTo"), + ltk.Link("https://api.jquery.com/prepend", "prepend"), + ltk.Link("https://api.jquery.com/eq", "eq"), + ltk.Link("https://api.jquery.com/after", "after"), + ltk.Link("https://api.jquery.com/before", "before"), + ltk.Link("https://api.jquery.com/css", "css"), + ltk.Link("https://api.jquery.com/remove", "remove."), + ), ltk.Container( ltk.Button("Append", append), ltk.Button("AppendTo", append_to), diff --git a/ltk/widgets.py b/ltk/widgets.py index 7a30b4e..2b8ee1b 100644 --- a/ltk/widgets.py +++ b/ltk/widgets.py @@ -478,6 +478,7 @@ class Link(Text): def __init__(self, href, *items): Widget.__init__(self, *items) self.attr("href", href) + self.attr("target", "_blank") class Strong(Text):