hook-ttkwidgets.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # ------------------------------------------------------------------
  2. # Copyright (c) 2020 PyInstaller Development Team.
  3. #
  4. # This file is distributed under the terms of the GNU General Public
  5. # License (version 2.0 or later).
  6. #
  7. # The full license is available in LICENSE, distributed with
  8. # this software.
  9. #
  10. # SPDX-License-Identifier: GPL-2.0-or-later
  11. # ------------------------------------------------------------------
  12. """
  13. Hook for use with the ttkwidgets package
  14. ttkwidgets provides a set of cross-platform widgets for Tkinter/ttk,
  15. some of which depend on image files in order to function properly.
  16. These images files are all provided in the `ttkwidgets/assets` folder,
  17. which has to be copied by PyInstaller.
  18. This hook has been tested on Ubuntu 18.04 (Python 3.6.8 venv) and
  19. Windows 7 (Python 3.5.4 system-wide).
  20. >>> import tkinter as tk
  21. >>> from ttkwidgets import CheckboxTreeview
  22. >>>
  23. >>> window = tk.Tk()
  24. >>> tree = CheckboxTreeview(window)
  25. >>> tree.insert("", tk.END, "test", text="Hello World!")
  26. >>> tree.insert("test", tk.END, "test2", text="Hello World again!")
  27. >>> tree.insert("test", tk.END, "test3", text="Hello World again again!")
  28. >>> tree.pack()
  29. >>> window.mainloop()
  30. """
  31. from PyInstaller.utils.hooks import collect_data_files
  32. datas = collect_data_files("ttkwidgets")