napari / napari-console

A plugin that adds a console to napari
BSD 3-Clause "New" or "Revised" License
3 stars 12 forks source link

napari-console should (maybe?) set viewer window as its parent #15

Open jni opened 3 years ago

jni commented 3 years ago

When I tried to use Ctrl-W to close napari as a shortcut with the console open, I got the traceback:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~/projects/napari/napari/_qt/qt_main_window.py in close_window(self=<napari._qt.qt_main_window._QtMainWindow object>)
    263                 break
    264 
--> 265             parent = parent.parent()
        parent = <napari_console.qt_console.QtConsole object at 0x7f08c3cee550>
        parent.parent = None
    266 
    267     def closeEvent(self, event):

TypeError: 'NoneType' object is not callable

possibly setting the viewer as the parent would work, but I don't actually know this.

psobolewskiPhD commented 2 years ago

For what it's worth, on my macOS 12.5.1 and napari 0.4.16 using Command-W while typing in console works and kills the viewer.