Commit cceab42f authored by Adrien Plazas's avatar Adrien Plazas Committed by Guido Gunther

example: Do not access event fields

This is needed to port to GTK+ 4 as these fields will be private.
parent 721d166d
......@@ -51,9 +51,14 @@ example_window_key_pressed_cb (GtkWidget *sender,
ExampleWindow *self)
{
GdkModifierType default_modifiers = gtk_accelerator_get_default_mod_mask ();
guint keyval;
GdkModifierType state;
if ((event->keyval == GDK_KEY_q || event->keyval == GDK_KEY_Q) &&
(event->state & default_modifiers) == GDK_CONTROL_MASK) {
gdk_event_get_keyval ((GdkEvent *) event, &keyval);
gdk_event_get_state ((GdkEvent *) event, &state);
if ((keyval == GDK_KEY_q || keyval == GDK_KEY_Q) &&
(state & default_modifiers) == GDK_CONTROL_MASK) {
gtk_widget_destroy (GTK_WIDGET (self));
return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment