diff --git a/FlatCAMDraw.py b/FlatCAMDraw.py index e0a60788..e8bb9211 100644 --- a/FlatCAMDraw.py +++ b/FlatCAMDraw.py @@ -934,7 +934,9 @@ class FlatCAMDraw(QtCore.QObject): self.corner_snap_btn.trigger() ### Propagate to tool - response = self.active_tool.on_key(event.key) + response = None + if self.active_tool is not None: + response = self.active_tool.on_key(event.key) if response is not None: self.app.info(response) diff --git a/PlotCanvas.py b/PlotCanvas.py index 008b7856..65aad311 100644 --- a/PlotCanvas.py +++ b/PlotCanvas.py @@ -45,6 +45,9 @@ class PlotCanvas: # The canvas is the top level container (Gtk.DrawingArea) self.canvas = FigureCanvas(self.figure) + # self.canvas.setFocusPolicy(QtCore.Qt.ClickFocus) + # self.canvas.setFocus() + #self.canvas.set_hexpand(1) #self.canvas.set_vexpand(1) #self.canvas.set_can_focus(True) # For key press