]> git.phdru.name Git - m_librarian.git/blobdiff - m_librarian/wx/ListBooks.py
Feat(wx): Catch `Escape` in the grid and close the window
[m_librarian.git] / m_librarian / wx / ListBooks.py
index 3bcd331ab152c0d217657ad71490959e6ca3fbf6..b1f84a11345449e50da3e4f06d0ea84ead2894e2 100644 (file)
@@ -52,6 +52,14 @@ class ListBooksPanel(GridPanel):
         grid.AutoSizeColumns()
         grid.AutoSizeRows()
 
+    def OnDClick(self, event):
+        pass
+
+    def OnKeyDown(self, event):
+        if event.GetKeyCode() == wx.WXK_ESCAPE:
+            self.Parent.Close()
+        else:
+            event.Skip()
 
 class ListBooksWindow(GridWindow):