class_docstr: wxPython backend for Canvas abstract class.
class_docstr_tok: ["wxPython","backend","for","Canvas","abstract","class","."]
code: def __init__(self, vispy_canvas, **kwargs):
      BaseCanvasBackend.__init__(self, vispy_canvas)
      p = self._process_backend_kwargs(kwargs)
  
      # WX supports OS double-click events, so we set this here to
      # avoid double events
      self._double_click_supported = True
  
      # Set config
      self._gl_attribs = _set_config(p.context.config)
      # Deal with context
      p.context.shared.add_ref("wx", self)
      if p.context.shared.ref is self:
          self._gl_context = (
              None  # set for real once we init the GLCanvas
          )
      else:
          self._gl_context = p.context.shared.ref._gl_context
  
      if p.position is None:
          pos = wx.DefaultPosition
      else:
          pos = p.position
  
      if p.parent is None:
          style = (
              wx.MINIMIZE_BOX
              | wx.MAXIMIZE_BOX
              | wx.CLOSE_BOX
              | wx.SYSTEM_MENU
              | wx.CAPTION
              | wx.CLIP_CHILDREN
          )
          style |= wx.NO_BORDER if not p.decorate else wx.RESIZE_BORDER
          style |= wx.STAY_ON_TOP if p.always_on_top else 0
          self._frame = wx.Frame(
              None, wx.ID_ANY, p.title, pos, p.size, style
          )
  
          if not p.resizable:
              self._frame.SetSizeHints(
                  p.size[0], p.size[1], p.size[0], p.size[1]
              )
          if p.fullscreen is not False:
              if p.fullscreen is not True:
                  logger.warning(
                      "Cannot specify monitor number for wx "
                      "fullscreen, using default"
                  )
              self._fullscreen = True
          else:
              self._fullscreen = False
          _wx_app.SetTopWindow(self._frame)
          parent = self._frame
          self._frame.Show()
          self._frame.Raise()
          self._frame.Bind(wx.EVT_CLOSE, self.on_close)
      else:
          parent = p.parent
          self._frame = None
          self._fullscreen = False
      self._init = False
      GLCanvas.__init__(
          self,
          parent,
          wx.ID_ANY,
          pos=pos,
          size=p.size,
          style=0,
          name="GLCanvas",
          attribList=self._gl_attribs,
      )
  
      if self._gl_context is None:
          self._gl_context = glcanvas.GLContext(self)
  
      self.SetFocus()
      self._vispy_set_title(p.title)
      self._size = None
      self.Bind(wx.EVT_SIZE, self.on_resize)
      self.Bind(wx.EVT_PAINT, self.on_draw)
      self.Bind(wx.EVT_KEY_DOWN, self.on_key_down)
      self.Bind(wx.EVT_KEY_UP, self.on_key_up)
      self.Bind(wx.EVT_MOUSE_EVENTS, self.on_mouse_event)
      self._size_init = p.size
      self._vispy_set_visible(p.show)
  
imports: from __future__ import division
  from time import sleep
  import gc
  import warnings
  from ..base import BaseApplicationBackend, BaseCanvasBackend, BaseTimerBackend
  from ...util import keys, logger
  from ...util.ptime import time
  from ...None import config
label_desc: Use image node_id 1 to create a new CanvasBackend object from inherited base classes: GLCanvas, BaseCanvasBackend with example: obj = CanvasBackend(vispy_canvas)