code: def __init__(self, *trees):
      from math import ceil, sqrt
  
      self._trees = trees
  
      self._top = Tk()
      self._top.title("NLTK")
      self._top.bind("<Control-x>", self.destroy)
      self._top.bind("<Control-q>", self.destroy)
  
      cf = self._cframe = CanvasFrame(self._top)
      self._top.bind("<Control-p>", self._cframe.print_to_file)
  
      # Size is variable.
      self._size = IntVar(self._top)
      self._size.set(12)
      bold = ("helvetica", -self._size.get(), "bold")
      helv = ("helvetica", -self._size.get())
  
      # Lay the trees out in a square.
      self._width = int(ceil(sqrt(len(trees))))
      self._widgets = []
      for i in range(len(trees)):
          widget = TreeWidget(
              cf.canvas(),
              trees[i],
              node_font=bold,
              leaf_color="#008040",
              node_color="#004080",
              roof_color="#004040",
              roof_fill="white",
              line_color="#004040",
              draggable=1,
              leaf_font=helv,
          )
          widget.bind_click_trees(widget.toggle_collapsed)
          self._widgets.append(widget)
          cf.add_widget(widget, 0, 0)
  
      self._layout()
      self._cframe.pack(expand=1, fill="both")
      self._init_menubar()
  
imports: from tkinter import IntVar, Menu, Tk
  from nltk.draw.util import BoxWidget, CanvasFrame, CanvasWidget, OvalWidget, ParenWidget, TextWidget
  from nltk.tree import Tree
  from nltk.util import in_idle
label_desc: Use image node_id 1 to create a new TreeView object  with example: obj = TreeView()