We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
examples/tutorial/app/simple_wx.py issue
```
Traceback (most recent call last):
  File "simple_wx.py", line 58, in <module>
    frame = TestFrame()
  File "simple_wx.py", line 49, in __init__
    self.canvas = Canvas(app="wx", parent=self, show=True)
  File "simple_wx.py", line 20, in __init__
    app.Canvas.__init__(self, *args, **kwargs)
  File "/home/eldar/src/vispy/vispy/app/canvas.py", line 208, in __init__
    self.set_current()
  File "/home/eldar/src/vispy/vispy/app/canvas.py", line 406, in set_current
    self._backend._vispy_set_current()
  File "/home/eldar/src/vispy/vispy/app/backends/_wx.py", line 302, in _vispy_set_current
    self.SetCurrent(self._gl_context)
wx._core.wxAssertionError: C++ assertion "xid" failed at /home/eldar/src/wx/wxPython_Phoenix/wxPython-4.0.0b2/ext/wxWidgets/src/unix/glx11.cpp(194) in SetCurrent(): window must be shown
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `examples/tutorial/app/simple_wx.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 # vispy: testskip
3 # Copyright (c) 2015, Vispy Development Team.
4 # Distributed under the (new) BSD License. See LICENSE.txt for more info.
5 """
6 This is a very minimal example that opens a window and makes the background
7 color to change from black to white to black ...
8 
9 The wx backend is used to embed the canvas in a simple wx Frame with
10 a menubar.
11 """
12 
13 import wx
14 import math
15 from vispy import app, gloo
16 
17 
18 class Canvas(app.Canvas):
19     def __init__(self, *args, **kwargs):
20         app.Canvas.__init__(self, *args, **kwargs)
21         self._timer = app.Timer('auto', connect=self.on_timer, start=True)
22         self.tick = 0
23 
24     def on_draw(self, event):
25         gloo.clear(color=True)
26 
27     def on_timer(self, event):
28         self.tick += 1 / 60.0
29         c = abs(math.sin(self.tick))
30         gloo.set_clear_color((c, c, c, 1))
31         self.update()
32 
33     def stop_timer(self):
34         self._timer.stop()
35 
36 
37 class TestFrame(wx.Frame):
38     def __init__(self):
39         wx.Frame.__init__(self, None, -1, "Vispy Test",
40                           wx.DefaultPosition, size=(500, 500))
41 
42         MenuBar = wx.MenuBar()
43         file_menu = wx.Menu()
44         file_menu.Append(wx.ID_EXIT, "&Quit")
45         self.Bind(wx.EVT_MENU, self.on_quit, id=wx.ID_EXIT)
46         MenuBar.Append(file_menu, "&File")
47         self.SetMenuBar(MenuBar)
48 
49         self.canvas = Canvas(app="wx", parent=self, show=True)
50 
51     def on_quit(self, event):
52         self.canvas.stop_timer()
53         self.Close(True)
54 
55 
56 if __name__ == '__main__':
57     myapp = wx.App(0)
58     frame = TestFrame()
59     frame.Show(True)
60     myapp.MainLoop()
61
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/examples/tutorial/app/simple_wx.py b/examples/tutorial/app/simple_wx.py
--- a/examples/tutorial/app/simple_wx.py
+++ b/examples/tutorial/app/simple_wx.py
@@ -43,15 +43,20 @@
         file_menu = wx.Menu()
         file_menu.Append(wx.ID_EXIT, "&Quit")
         self.Bind(wx.EVT_MENU, self.on_quit, id=wx.ID_EXIT)
+        self.Bind(wx.EVT_SHOW, self.on_show)
         MenuBar.Append(file_menu, "&File")
         self.SetMenuBar(MenuBar)
 
-        self.canvas = Canvas(app="wx", parent=self, show=True)
+        self.canvas = Canvas(app="wx", parent=self)
 
     def on_quit(self, event):
         self.canvas.stop_timer()
         self.Close(True)
 
+    def on_show(self, event):
+        self.canvas.show()
+        event.Skip()
+
 
 if __name__ == '__main__':
     myapp = wx.App(0)

{"golden_diff": "diff --git a/examples/tutorial/app/simple_wx.py b/examples/tutorial/app/simple_wx.py\n--- a/examples/tutorial/app/simple_wx.py\n+++ b/examples/tutorial/app/simple_wx.py\n@@ -43,15 +43,20 @@\n         file_menu = wx.Menu()\n         file_menu.Append(wx.ID_EXIT, \"&Quit\")\n         self.Bind(wx.EVT_MENU, self.on_quit, id=wx.ID_EXIT)\n+        self.Bind(wx.EVT_SHOW, self.on_show)\n         MenuBar.Append(file_menu, \"&File\")\n         self.SetMenuBar(MenuBar)\n \n-        self.canvas = Canvas(app=\"wx\", parent=self, show=True)\n+        self.canvas = Canvas(app=\"wx\", parent=self)\n \n     def on_quit(self, event):\n         self.canvas.stop_timer()\n         self.Close(True)\n \n+    def on_show(self, event):\n+        self.canvas.show()\n+        event.Skip()\n+\n \n if __name__ == '__main__':\n     myapp = wx.App(0)\n", "issue": "examples/tutorial/app/simple_wx.py issue\n```\r\nTraceback (most recent call last):\r\n  File \"simple_wx.py\", line 58, in <module>\r\n    frame = TestFrame()\r\n  File \"simple_wx.py\", line 49, in __init__\r\n    self.canvas = Canvas(app=\"wx\", parent=self, show=True)\r\n  File \"simple_wx.py\", line 20, in __init__\r\n    app.Canvas.__init__(self, *args, **kwargs)\r\n  File \"/home/eldar/src/vispy/vispy/app/canvas.py\", line 208, in __init__\r\n    self.set_current()\r\n  File \"/home/eldar/src/vispy/vispy/app/canvas.py\", line 406, in set_current\r\n    self._backend._vispy_set_current()\r\n  File \"/home/eldar/src/vispy/vispy/app/backends/_wx.py\", line 302, in _vispy_set_current\r\n    self.SetCurrent(self._gl_context)\r\nwx._core.wxAssertionError: C++ assertion \"xid\" failed at /home/eldar/src/wx/wxPython_Phoenix/wxPython-4.0.0b2/ext/wxWidgets/src/unix/glx11.cpp(194) in SetCurrent(): window must be shown\r\n```\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# vispy: testskip\n# Copyright (c) 2015, Vispy Development Team.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\"\"\"\nThis is a very minimal example that opens a window and makes the background\ncolor to change from black to white to black ...\n\nThe wx backend is used to embed the canvas in a simple wx Frame with\na menubar.\n\"\"\"\n\nimport wx\nimport math\nfrom vispy import app, gloo\n\n\nclass Canvas(app.Canvas):\n    def __init__(self, *args, **kwargs):\n        app.Canvas.__init__(self, *args, **kwargs)\n        self._timer = app.Timer('auto', connect=self.on_timer, start=True)\n        self.tick = 0\n\n    def on_draw(self, event):\n        gloo.clear(color=True)\n\n    def on_timer(self, event):\n        self.tick += 1 / 60.0\n        c = abs(math.sin(self.tick))\n        gloo.set_clear_color((c, c, c, 1))\n        self.update()\n\n    def stop_timer(self):\n        self._timer.stop()\n\n\nclass TestFrame(wx.Frame):\n    def __init__(self):\n        wx.Frame.__init__(self, None, -1, \"Vispy Test\",\n                          wx.DefaultPosition, size=(500, 500))\n\n        MenuBar = wx.MenuBar()\n        file_menu = wx.Menu()\n        file_menu.Append(wx.ID_EXIT, \"&Quit\")\n        self.Bind(wx.EVT_MENU, self.on_quit, id=wx.ID_EXIT)\n        MenuBar.Append(file_menu, \"&File\")\n        self.SetMenuBar(MenuBar)\n\n        self.canvas = Canvas(app=\"wx\", parent=self, show=True)\n\n    def on_quit(self, event):\n        self.canvas.stop_timer()\n        self.Close(True)\n\n\nif __name__ == '__main__':\n    myapp = wx.App(0)\n    frame = TestFrame()\n    frame.Show(True)\n    myapp.MainLoop()\n", "path": "examples/tutorial/app/simple_wx.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# vispy: testskip\n# Copyright (c) 2015, Vispy Development Team.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\"\"\"\nThis is a very minimal example that opens a window and makes the background\ncolor to change from black to white to black ...\n\nThe wx backend is used to embed the canvas in a simple wx Frame with\na menubar.\n\"\"\"\n\nimport wx\nimport math\nfrom vispy import app, gloo\n\n\nclass Canvas(app.Canvas):\n    def __init__(self, *args, **kwargs):\n        app.Canvas.__init__(self, *args, **kwargs)\n        self._timer = app.Timer('auto', connect=self.on_timer, start=True)\n        self.tick = 0\n\n    def on_draw(self, event):\n        gloo.clear(color=True)\n\n    def on_timer(self, event):\n        self.tick += 1 / 60.0\n        c = abs(math.sin(self.tick))\n        gloo.set_clear_color((c, c, c, 1))\n        self.update()\n\n    def stop_timer(self):\n        self._timer.stop()\n\n\nclass TestFrame(wx.Frame):\n    def __init__(self):\n        wx.Frame.__init__(self, None, -1, \"Vispy Test\",\n                          wx.DefaultPosition, size=(500, 500))\n\n        MenuBar = wx.MenuBar()\n        file_menu = wx.Menu()\n        file_menu.Append(wx.ID_EXIT, \"&Quit\")\n        self.Bind(wx.EVT_MENU, self.on_quit, id=wx.ID_EXIT)\n        self.Bind(wx.EVT_SHOW, self.on_show)\n        MenuBar.Append(file_menu, \"&File\")\n        self.SetMenuBar(MenuBar)\n\n        self.canvas = Canvas(app=\"wx\", parent=self)\n\n    def on_quit(self, event):\n        self.canvas.stop_timer()\n        self.Close(True)\n\n    def on_show(self, event):\n        self.canvas.show()\n        event.Skip()\n\n\nif __name__ == '__main__':\n    myapp = wx.App(0)\n    frame = TestFrame()\n    frame.Show(True)\n    myapp.MainLoop()\n", "path": "examples/tutorial/app/simple_wx.py"}]}