class_docstr: Tkinter backend for Canvas abstract class.
  Uses pyopengltk.OpenGLFrame as the internal tk.Frame instance that
  is able to receive OpenGL draw commands and display the results,
  while also being placeable in another Toplevel window.
class_docstr_tok: ["Tkinter","backend","for","Canvas","abstract","class",".","Uses","pyopengltk.OpenGLFrame","as","the","internal","tk.Frame","instance","that","is","able","to","receive","OpenGL","draw","commands","and","display","the","results",",","while","also","being","placeable","in","another","Toplevel","window","."]
code: def __init__(self, vispy_canvas, **kwargs):
      BaseCanvasBackend.__init__(self, vispy_canvas)
      p = self._process_backend_kwargs(kwargs)
  
      self._double_click_supported = True
  
      # Deal with config
      # ... use context.config
      # Deal with context
      p.context.shared.add_ref("tk", self)
      if p.context.shared.ref is self:
          self._native_context = None
      else:
          self._native_context = p.context.shared.ref._native_context
  
      # Pop args unrecognised by OpenGLFrame
      kwargs.pop("parent")
      kwargs.pop("title")
      kwargs.pop("size")
      kwargs.pop("position")
      kwargs.pop("show")
      kwargs.pop("vsync")
      kwargs.pop("resizable")
      kwargs.pop("decorate")
      kwargs.pop("always_on_top")
      kwargs.pop("fullscreen")
      kwargs.pop("context")
  
      if p.parent is None:
          # Create native window and top level
          self.top = _TkInstanceManager.new_toplevel(self)
  
          # Check input args and call appropriate set-up functions.
          if p.title:
              self._vispy_set_title(p.title)
          if p.size:
              self._vispy_set_size(p.size[0], p.size[1])
          if p.position:
              self._vispy_set_position(p.position[0], p.position[1])
  
          self.top.update_idletasks()
  
          if not p.resizable:
              self.top.resizable(False, False)
          if not p.decorate:
              self.top.overrideredirect(True)
          if p.always_on_top:
              self.top.wm_attributes("-topmost", "True")
          self._fullscreen = bool(p.fullscreen)
  
          self.top.protocol("WM_DELETE_WINDOW", self._vispy_close)
          parent = self.top
      else:
          # Use given parent as top level
          self.top = None
          parent = p.parent
          self._fullscreen = False
  
      self._init = False
      self.is_destroyed = False
      self._dynamic_keymap = {}
  
      OpenGLFrame.__init__(self, parent, **kwargs)
  
      if self.top:
          # Embed canvas in top (new window) if this was created
          self.top.configure(bg="black")
          self.pack(fill=tk.BOTH, expand=True)
  
          # Also bind the key events to the top window instead.
          self.top.bind("<Any-KeyPress>", self._on_key_down)
          self.top.bind("<Any-KeyRelease>", self._on_key_up)
      else:
          # If no top, bind key events to the canvas itself.
          self.bind("<Any-KeyPress>", self._on_key_down)
          self.bind("<Any-KeyRelease>", self._on_key_up)
  
      # Bind the other events to our internal methods.
      self.bind(
          "<Enter>", self._on_mouse_enter
      )  # This also binds MouseWheel
      self.bind(
          "<Leave>", self._on_mouse_leave
      )  # This also unbinds MouseWheel
      self.bind("<Motion>", self._on_mouse_move)
      self.bind("<Any-Button>", self._on_mouse_button_press)
      self.bind(
          "<Double-Any-Button>", self._on_mouse_double_button_press
      )
      self.bind("<Any-ButtonRelease>", self._on_mouse_button_release)
      self.bind("<Configure>", self._on_configure, add="+")
  
      self._vispy_set_visible(p.show)
      self.focus_force()
  
imports: from __future__ import division
  from time import sleep
  import warnings
  from ..base import BaseApplicationBackend, BaseCanvasBackend, BaseTimerBackend
  from ...util import keys
  from ...util.ptime import time
  from ...gloo import gl
label_desc: Use image node_id 1 to create a new CanvasBackend object from inherited base classes: BaseCanvasBackend, OpenGLFrame with example: obj = CanvasBackend(vispy_canvas)