Skip to content

Commit

Permalink
Fix support for wxPython 3.0
Browse files Browse the repository at this point in the history
Retains compatibility with 2.8 - there wx.InitAllImageHandlers() is a no-op,
wx.HIDE_READONLY is 0, and wx.PySimpleApp() issues a deprecation warning.

Patch originally by Olly Betts <[email protected]>
  • Loading branch information
swt2c committed Dec 31, 2019
1 parent 749199d commit 90e1f39
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/source/mayavi/auto/wx_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, parent, id):
kind='subpanel').control
self.Show(True)

app = wx.PySimpleApp()
app = wx.App(False)
frame = MainWindow(None, wx.ID_ANY)
app.MainLoop()

2 changes: 1 addition & 1 deletion docs/source/mayavi/auto/wx_mayavi_embed_in_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ def __init__(self, parent, id):
self.Show(True)

if __name__ == '__main__':
app = wx.PySimpleApp()
app = wx.App(False)
frame = MainWindow(None, wx.ID_ANY)
app.MainLoop()
2 changes: 1 addition & 1 deletion docs/source/mayavi/building_applications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Using the `Visualization` class defined above::
kind='subpanel').control
self.Show()

app = wx.PySimpleApp()
app = wx.App(False)
frame = MainWindow(None, wx.ID_ANY)
app.MainLoop()

Expand Down
2 changes: 1 addition & 1 deletion examples/mayavi/interactive/wx_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, parent, id):
kind='subpanel').control
self.Show(True)

app = wx.PySimpleApp()
app = wx.App(False)
frame = MainWindow(None, wx.ID_ANY)
app.MainLoop()

2 changes: 1 addition & 1 deletion examples/mayavi/interactive/wx_mayavi_embed_in_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ def __init__(self, parent, id):
self.Show(True)

if __name__ == '__main__':
app = wx.PySimpleApp()
app = wx.App(False)
frame = MainWindow(None, wx.ID_ANY)
app.MainLoop()
6 changes: 3 additions & 3 deletions tvtk/util/wx_gradient_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def on_save(self, event):
(lookuptable) ``*.grad`` (gradient table for use with this program),
and ``*.jpg`` (image of the gradient)
"""
dlg = wx.FileDialog(self, "Save LUT to...", style=wx.SAVE)
dlg = wx.FileDialog(self, "Save LUT to...", style=wx.FD_SAVE)
wildcard = "Gradient Files (.grad)|*.grad|" \
"All files (*.*)|*.*"
dlg.SetWildcard(wildcard)
Expand All @@ -406,7 +406,7 @@ def on_load(self, event):
"""
Load a ``*.grad`` lookuptable file using wxpython dialog
"""
style = wx.OPEN | wx.HIDE_READONLY
style = wx.FD_OPEN
dlg = wx.FileDialog(self, "Open a file", style=style)
wildcard = "Gradient Files (.grad)|*.grad|" \
"All files (*.*)|*.*"
Expand Down Expand Up @@ -511,7 +511,7 @@ def on_color_table_changed():
"""If we had a vtk window running, update it here"""
print("Update Render Window")

app = wx.PySimpleApp()
app = wx.App(False)
editor = wxGradientEditor(table,
on_color_table_changed,
colors=['rgb', 'a', 'h', 's', 'v'],
Expand Down

0 comments on commit 90e1f39

Please sign in to comment.