tkinterweb 4.17.4__tar.gz → 4.17.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tkinterweb-4.17.4/tkinterweb.egg-info → tkinterweb-4.17.5}/PKG-INFO +1 -1
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/setup.py +1 -1
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb/bindings.py +14 -14
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb/htmlwidgets.py +7 -10
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb/utilities.py +1 -1
- {tkinterweb-4.17.4 → tkinterweb-4.17.5/tkinterweb.egg-info}/PKG-INFO +1 -1
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/LICENSE.md +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/MANIFEST.in +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/README.md +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/setup.cfg +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb/__init__.py +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb/dom.py +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb/extensions.py +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb/handlers.py +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb/imageutils.py +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb/js.py +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb/resources/combobox-2.3.tm +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb/resources/pkgIndex.tcl +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb/subwidgets.py +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb.egg-info/SOURCES.txt +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb.egg-info/dependency_links.txt +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb.egg-info/requires.txt +0 -0
- {tkinterweb-4.17.4 → tkinterweb-4.17.5}/tkinterweb.egg-info/top_level.txt +0 -0
|
@@ -584,7 +584,7 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
|
|
|
584
584
|
# --- HTML/CSS parsing ----------------------------------------------------
|
|
585
585
|
|
|
586
586
|
def parse(self, html, thread_safe=False):
|
|
587
|
-
"Parse HTML code. reset
|
|
587
|
+
"Parse HTML code. Call :meth:`TkinterWeb.reset` before calling this method for the first time."
|
|
588
588
|
# NOTE: when thread_safe=True, this method is thread-safe
|
|
589
589
|
|
|
590
590
|
self.downloads_have_occured = False
|
|
@@ -769,20 +769,20 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
|
|
|
769
769
|
else:
|
|
770
770
|
return None, None
|
|
771
771
|
|
|
772
|
-
def text(self, *args):
|
|
773
|
-
"
|
|
774
|
-
return self.tk.call(self._w, "text", *args)
|
|
772
|
+
def text(self, subcommand, *args):
|
|
773
|
+
"Interact with the text of the HTML document. Valid subcommands are bbox, index, offset, and text."
|
|
774
|
+
return self.tk.call(self._w, "text", subcommand, *args)
|
|
775
775
|
|
|
776
776
|
def tag(self, subcommand, tag_name, *args):
|
|
777
|
-
"
|
|
777
|
+
"Highlight regions of text displayed by the widget. Valid subcommands are add, remove, configure, and delete."
|
|
778
778
|
return self.tk.call(self._w, "tag", subcommand, tag_name, *args)
|
|
779
779
|
|
|
780
780
|
def search(self, selector, *a, cnf={}, **kw):
|
|
781
|
-
"""Search the document for the specified CSS selector; return a
|
|
781
|
+
"""Search the document for the specified CSS selector; return a Tkhtml node if found."""
|
|
782
782
|
return self.tk.call((self._w, "search", selector)+utilities.TclOpt(a)+self._options(cnf, kw))
|
|
783
783
|
|
|
784
784
|
def xview(self, *args, auto_scroll=False):
|
|
785
|
-
"
|
|
785
|
+
"Control horizontal scrolling."
|
|
786
786
|
#if args:
|
|
787
787
|
# return self.tk.call(self._w, "xview", *args)
|
|
788
788
|
#coords = map(float, self.tk.call(self._w, "xview").split()) #raises an error
|
|
@@ -802,7 +802,7 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
|
|
|
802
802
|
return self.xview("moveto", number, auto_scroll=auto_scroll)
|
|
803
803
|
|
|
804
804
|
def yview(self, *args, auto_scroll=False):
|
|
805
|
-
"""
|
|
805
|
+
"""Control vertical scrolling."""
|
|
806
806
|
yview = self.tk.call(self._w, "yview", *args)
|
|
807
807
|
if args:
|
|
808
808
|
self.caret_manager.update(auto_scroll=auto_scroll)
|
|
@@ -970,11 +970,11 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
|
|
|
970
970
|
self.tk.call(node, "dynamic", "set", name)
|
|
971
971
|
|
|
972
972
|
def remove_node_flags(self, node, name):
|
|
973
|
-
"
|
|
973
|
+
"remove dynamic flags on the given node."
|
|
974
974
|
self.tk.call(node, "dynamic", "clear", name)
|
|
975
975
|
|
|
976
976
|
def get_node_tkhtml(self, node_handle):
|
|
977
|
-
"Get the path name of node."
|
|
977
|
+
"Get the path name of the node's corresponding Tkhtml instance."
|
|
978
978
|
return self.tk.call(node_handle, "html")
|
|
979
979
|
|
|
980
980
|
def get_node_stacking(self, node_handle):
|
|
@@ -985,7 +985,7 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
|
|
|
985
985
|
return self.tk.call(node_handle, "stacking")
|
|
986
986
|
|
|
987
987
|
def get_current_hovered_node(self, event):
|
|
988
|
-
"Get current node."
|
|
988
|
+
"Get the current node."
|
|
989
989
|
if self.widget_manager.hovered_embedded_node:
|
|
990
990
|
return self.widget_manager.hovered_embedded_node
|
|
991
991
|
|
|
@@ -994,11 +994,11 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
|
|
|
994
994
|
)
|
|
995
995
|
|
|
996
996
|
def get_current_hovered_node_parent(self, node):
|
|
997
|
-
"Get the parent of the
|
|
997
|
+
"Get the parent of the node returned by :meth:`TkinterWeb.get_current_hovered_node`."
|
|
998
998
|
return self.tk.eval(f"""set node [lindex [lindex [{node} parent] end] end]""")
|
|
999
999
|
|
|
1000
1000
|
def register_handler(self, handler_type, node_tag, callback):
|
|
1001
|
-
"Register a node handler"
|
|
1001
|
+
"Register a node handler."
|
|
1002
1002
|
self.tk.call(self._w, "handler", handler_type, node_tag, self.register(callback))
|
|
1003
1003
|
|
|
1004
1004
|
def _lazy_handler(self, manager, method):
|
|
@@ -1008,7 +1008,7 @@ It is likely that not all dependencies are installed. Make sure Cairo is install
|
|
|
1008
1008
|
return callback
|
|
1009
1009
|
|
|
1010
1010
|
def register_lazy_handler(self, handler_type, node_tag, manager_name):
|
|
1011
|
-
"Register a node handler to run in the given manager"
|
|
1011
|
+
"Register a node handler to run lazily in the given manager."
|
|
1012
1012
|
if handler_type == "attribute":
|
|
1013
1013
|
callback_name = f"_on_{node_tag}_value_change"
|
|
1014
1014
|
else:
|
|
@@ -1106,6 +1106,9 @@ class HtmlFrame(Frame):
|
|
|
1106
1106
|
"""Make all elements with the 'tkinterweb-full-page' attribute the same height as the html widget.
|
|
1107
1107
|
This can be used in conjunction with table elements to vertical align pages,
|
|
1108
1108
|
which is otherwise not possible with Tkhtml. Hopefully we won't need this forever."""
|
|
1109
|
+
if self._html.cget("shrink"):
|
|
1110
|
+
return
|
|
1111
|
+
|
|
1109
1112
|
if event:
|
|
1110
1113
|
height = event.height
|
|
1111
1114
|
else:
|
|
@@ -1422,18 +1425,12 @@ class HtmlLabel(HtmlFrame):
|
|
|
1422
1425
|
|
|
1423
1426
|
self._style = Style()
|
|
1424
1427
|
|
|
1425
|
-
if text:
|
|
1426
|
-
|
|
1427
|
-
# I'd like to just make this an else statement
|
|
1428
|
-
# But someone in issue 145 mentioned layout issues when that was the case
|
|
1429
|
-
# I can't seem to reproduce it though...?
|
|
1428
|
+
if text: self.load_html(text)
|
|
1429
|
+
# I'd like to just make this an else statement to prevent the widget from being a massive white screen when text=""
|
|
1430
1430
|
elif self.unshrink or (not self._html.using_tkhtml30 and not self._html.cget("textwrap")):
|
|
1431
|
+
# A fellow in issue 145 mentioned layout issues when this was used
|
|
1432
|
+
# I can't seem to reproduce it though...?
|
|
1431
1433
|
self.load_html("<body></body>", _relayout=False)
|
|
1432
|
-
|
|
1433
|
-
def _handle_html_resize(self, *args, **kwargs):
|
|
1434
|
-
# Overwrite HtmlFrame._handle_html_resize, which is not necessary when shrink is set to True
|
|
1435
|
-
# HtmlFrame._handle_html_resize also causes weird behaviour when tables are present and shrink set to True
|
|
1436
|
-
return
|
|
1437
1434
|
|
|
1438
1435
|
def load_html(self, *args, _relayout=True, **kwargs):
|
|
1439
1436
|
""
|
|
@@ -31,7 +31,7 @@ __title__ = "TkinterWeb"
|
|
|
31
31
|
__author__ = "Andrew Clarke"
|
|
32
32
|
__copyright__ = "(c) 2021-2025 Andrew Clarke"
|
|
33
33
|
__license__ = "MIT"
|
|
34
|
-
__version__ = "4.17.
|
|
34
|
+
__version__ = "4.17.5"
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
ROOT_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "resources")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|