mirror of
https://github.com/Taiko2k/GTK4PythonTutorial.git
synced 2025-07-21 20:51:10 +02:00
Gdk is imported a little bit earlier than mentioned
This commit is contained in:
@@ -526,7 +526,7 @@ See also: [EventControllerKey](https://docs.gtk.org/gtk4/class.EventControllerKe
|
||||
evk.connect("key-pressed", self.key_press)
|
||||
self.add_controller(evk) # add to window
|
||||
def key_press(self, event, keyval, keycode, state):
|
||||
if keyval == Gdk.KEY_q and state & Gdk.ModifierType.CONTROL_MASK:
|
||||
if keyval == Gdk.KEY_q and state & Gdk.ModifierType.CONTROL_MASK: # Add Gdk to your imports. i.e. from gi import Gdk
|
||||
self.close()
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user