tkinterweb 4.17.4__py3-none-any.whl → 4.17.5__py3-none-any.whl

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/bindings.py CHANGED
@@ -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() must be called before running parse() for the first time."
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
- "Enable interaction with the text of the HTML document."
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
- "Return the name of the Html tag that generated this document node, or an empty string if the node is a text node."
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 Tkhtml3 node if found."""
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
- "Used to control horizontal scrolling."
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
- """Used to control vertical scrolling."""
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
- "Set dynamic flags on the given node."
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 given node."
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:
tkinterweb/htmlwidgets.py CHANGED
@@ -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
- self.load_html(text)
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
  ""
tkinterweb/utilities.py CHANGED
@@ -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.4"
34
+ __version__ = "4.17.5"
35
35
 
36
36
 
37
37
  ROOT_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "resources")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tkinterweb
3
- Version: 4.17.4
3
+ Version: 4.17.5
4
4
  Summary: HTML/CSS viewer, editor, and app builder for Tkinter
5
5
  Home-page: https://github.com/Andereoo/TkinterWeb
6
6
  License: MIT
@@ -1,17 +1,17 @@
1
1
  tkinterweb/__init__.py,sha256=mKnt2RjNd0zMntvkmT4dn5iyytsko7fJJb-rnx4H82E,4690
2
- tkinterweb/bindings.py,sha256=XE0CPX28YtwBW9g9l0nsVVSHe3O3pX19w6POxorX8_k,73563
2
+ tkinterweb/bindings.py,sha256=dmWC_fnkA8Byg68KmapVUuA6b-xo4tHgbLgDrjE2HFU,73721
3
3
  tkinterweb/dom.py,sha256=6zEZUGMSdWuwu1-MQOpt1XJN-w_Aku1HGY5P2iM2ksE,43546
4
4
  tkinterweb/extensions.py,sha256=QfV13omkMoeXe17JPbeJjykwXtWTcZ24mKuB7NoBgVI,46555
5
5
  tkinterweb/handlers.py,sha256=3ptECxVAiSarldfi4_C_mqd7A9xyTzpqvgwOKcBCX_I,42583
6
- tkinterweb/htmlwidgets.py,sha256=oY54k7MHh-h0vv2f1ueKKLFQ_xdzMncxy_iP2dPvi6M,104583
6
+ tkinterweb/htmlwidgets.py,sha256=f0BYn73_L--qIvgBY71M_rRgbMhw1CaBccWcC3JNGdc,104412
7
7
  tkinterweb/imageutils.py,sha256=Du6vX00Isx7z1Q6sVV4po9ycYrP_iDG22ScG04U_huQ,5368
8
8
  tkinterweb/js.py,sha256=Wlameh5KGK3GKzBCczaWYWT1L6-5uOWHt1HCZmzrjLk,3597
9
9
  tkinterweb/subwidgets.py,sha256=wT4gtUnUE5j9UA8lrKCjLaysWqHav-_46NF97uMswDo,28200
10
- tkinterweb/utilities.py,sha256=qbIa6pVBcszMGUnADQS3FWNRUNGfh7WqeslcDms76Qs,43431
10
+ tkinterweb/utilities.py,sha256=n9P2abX9zxx2R4p9uYZpBugh1FtpXHsc5bQaEL7zB98,43431
11
11
  tkinterweb/resources/combobox-2.3.tm,sha256=flofzRxHJMeEj0I--4iLT9SWIo9G1MSIwY0h940tG-U,65083
12
12
  tkinterweb/resources/pkgIndex.tcl,sha256=Zp99aTL170d0TbVrWS-6uzaIaykUQbRO0krvmJhcduA,77
13
- tkinterweb-4.17.4.dist-info/LICENSE.md,sha256=Jf8BR3uTR9RLMAA2osul_ZRkvoYRgmlqq1Pd-xt0uMY,1074
14
- tkinterweb-4.17.4.dist-info/METADATA,sha256=GEebp4G7WKDAUcdRFPjqgJTstCS5qnw20In6nMXyVg0,3133
15
- tkinterweb-4.17.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
16
- tkinterweb-4.17.4.dist-info/top_level.txt,sha256=QVZQjAzSgzBGwOl41qcOyvkYAwy1FXLlnvwtYvE9Ur4,11
17
- tkinterweb-4.17.4.dist-info/RECORD,,
13
+ tkinterweb-4.17.5.dist-info/LICENSE.md,sha256=Jf8BR3uTR9RLMAA2osul_ZRkvoYRgmlqq1Pd-xt0uMY,1074
14
+ tkinterweb-4.17.5.dist-info/METADATA,sha256=q2ho2BAvubwNmZEdY1NS8f9fLFyUKwsw3QDTd69UMZ0,3133
15
+ tkinterweb-4.17.5.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
16
+ tkinterweb-4.17.5.dist-info/top_level.txt,sha256=QVZQjAzSgzBGwOl41qcOyvkYAwy1FXLlnvwtYvE9Ur4,11
17
+ tkinterweb-4.17.5.dist-info/RECORD,,