class_docstr: A simple text viewer dialog for IDLE.
docstr: Show the given text in a scrollable window with a 'close' button.
  
  If modal is left True, users cannot interact with other windows
  until the textview window is closed.
  
  parent - parent of this dialog
  title - string which is title of popup dialog
  contents - text to display in dialog
  wrap - type of text wrapping to use ('word', 'char' or 'none')
  _htest - bool; change box location when running htest.
  _utest - bool; don't wait_window when running unittest.
docstr_tok: ["Show","the","given","text","in","a","scrollable","window","with","a","'close","'","button",".","If","modal","is","left","True",",","users","can","not","interact","with","other","windows","until","the","textview","window","is","closed",".","parent","-","parent","of","this","dialog","title","-","string","which","is","title","of","popup","dialog","contents","-","text","to","display","in","dialog","wrap","-","type","of","text","wrapping","to","use","(","'word","'",",","'char","'","or","'none","'",")","_htest","-","bool",";","change","box","location","when","running","htest",".","_utest","-","bool",";","do","n't","wait_window","when","running","unittest","."]
code: def __init__(
      self,
      parent,
      title,
      contents,
      modal=True,
      wrap=WORD,
      *,
      _htest=False,
      _utest=False,
  ):
      """Show the given text in a scrollable window with a 'close' button.
  
      If modal is left True, users cannot interact with other windows
      until the textview window is closed.
  
      parent - parent of this dialog
      title - string which is title of popup dialog
      contents - text to display in dialog
      wrap - type of text wrapping to use ('word', 'char' or 'none')
      _htest - bool; change box location when running htest.
      _utest - bool; don't wait_window when running unittest.
      """
      super().__init__(parent)
      self["borderwidth"] = 5
      # Place dialog below parent if running htest.
      x = parent.winfo_rootx() + 10
      y = parent.winfo_rooty() + (10 if not _htest else 100)
      self.geometry(f"=750x500+{x}+{y}")
  
      self.title(title)
      self.viewframe = ViewFrame(self, contents, wrap=wrap)
      self.protocol("WM_DELETE_WINDOW", self.ok)
      self.button_ok = button_ok = Button(
          self, text="Close", command=self.ok, takefocus=False
      )
      self.viewframe.pack(side="top", expand=True, fill="both")
  
      self.is_modal = modal
      if self.is_modal:
          self.transient(parent)
          self.grab_set()
          if not _utest:
              self.wait_window()
  
imports: from tkinter import Toplevel, Text, TclError, HORIZONTAL, VERTICAL, NS, EW, NSEW, NONE, WORD, SUNKEN
  from tkinter.ttk import Frame, Scrollbar, Button
  from tkinter.messagebox import showerror
  from idlelib.colorizer import color_config
label_desc: Use image node_id 1 to create a new ViewWindow object from inherited base classes: Toplevel with example: obj = ViewWindow(parent, title, contents, modal, wrap)