python - Cannot close wxPython window on Mac -


I am now struggling in what I realize is that many different dragon accidents and / or applications are hanging out Because I try to integrate vtk into it, a wxPython GUI I have a different one that works with a stand-alone VTK example. During the window closure process, I got a square of problems around proper erosion of vtk objects. However, pursuing those issues, I have found out that I can not even clean a simple wx. Frame!

The following simple examples (provided as part of the answer of some other) fails to close me with Mac (running Mac OSX 1.48.1975 on 10.9.4) but my The windows run and stop at VM (the same canopy version is running).

Specifically, clicking the red "close" dot or "close" wx.button controls the integrated python prompt in canopy, but the window does not go away. With the "close" button I see the print statement, such as the control passes through the on-close function. In either case, restarting the Python kernel (Run -> "Restart Kernel ..." in the Sandwich menu bar) removes the window.

Import wx ##################################### ###################################### Class MyFrame (wx.Frame): "" "" "" # ------------------------------- -------------- ------------------------- def __init __ (self): "" "constructor" "" wx.frame .__ init __ (self, someone No, title = "turn me off") panel = wx.panel (auto) closeBtn = wx.button (panel, label = "off") closeBtn.Bind (wx.EVT_BUTTON, manually .onclose) # ----- ----------------------------------------- --------- --------------- Close the DRF (self, incident): "" "print 'on close' itself. Close () if __name__ =" __main__ ": app = wx. App (wrong) frame = myframe () frame. Edit the line (instead of Canoe's IDE) and saw the following:
  • Typing "Python simpleClose.py" on the [non-interactive] command line launches window and then normally closes in all forms

  • After typing "Python" on the [interactive] command line "execfile ('SimpleClose.py')" indicates interactive dragon that launches the window But after the close button is pressed, the window is open on the interactive dragon prompt at the control return (I can run more commands) but is not closed. The window also goes away after typing "exit" to close the interactive dragon. If instead, I try to launch the testing application again, I get a segfault as shown below:

[Mac prompt] $ Python

Eternal Canopy Python 2.7.6 | 64-bit | (Default, June 4 2014, 16:42:26) [GCC 4.2.1 (Created 5666) (dot 3) on Darwin Type "Help", "License", "Credit" or more "License" " Information. (Python Prompt) execfile ('simpleClose.py')

ON

[python prompt] execfile ('simpleClose.py') init wx.Frame. init (auto, none, title =" turn me off " Library / Enthought / Canopy_64bit / User / lib / python2.7 / site-packages / wx / _windows.py ", line 576, init windows frames_signin (Self, Windows .new_frame (* args, ** kwargs)) wx._core.PyNoAppError: wx.App objects must be created first!

[python prompt] exit ()

Segmentation error: 11

[MAC PROMPT] $

< P>

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -