Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pellegrino Prevete
libhandy
Commits
cceab42f
Commit
cceab42f
authored
Oct 30, 2018
by
Adrien Plazas
Committed by
Guido Gunther
Nov 06, 2018
Browse files
example: Do not access event fields
This is needed to port to GTK+ 4 as these fields will be private.
parent
721d166d
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/example-window.c
View file @
cceab42f
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment