mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
tests: Avoid a use of ::map-event
We can use the ::map signal here instead.
This commit is contained in:
parent
1e8a336993
commit
3cb93a479a
@ -147,8 +147,7 @@ tick_callback (GtkWidget *widget,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
on_map_event (GtkWidget *widget,
|
on_map (GtkWidget *widget)
|
||||||
GdkEventAny *event)
|
|
||||||
{
|
{
|
||||||
gtk_widget_add_tick_callback (window, tick_callback, NULL, NULL);
|
gtk_widget_add_tick_callback (window, tick_callback, NULL, NULL);
|
||||||
|
|
||||||
@ -200,8 +199,8 @@ main(int argc, char **argv)
|
|||||||
g_signal_connect (window, "destroy",
|
g_signal_connect (window, "destroy",
|
||||||
G_CALLBACK (gtk_main_quit), NULL);
|
G_CALLBACK (gtk_main_quit), NULL);
|
||||||
|
|
||||||
g_signal_connect (window, "map-event",
|
g_signal_connect (window, "map",
|
||||||
G_CALLBACK (on_map_event), NULL);
|
G_CALLBACK (on_map), NULL);
|
||||||
on_frame (0.);
|
on_frame (0.);
|
||||||
|
|
||||||
display = gtk_widget_get_display (window);
|
display = gtk_widget_get_display (window);
|
||||||
|
@ -29,9 +29,7 @@ place_popup (GtkWidget *parent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
on_map_event (GtkWidget *parent,
|
on_map (GtkWidget *parent)
|
||||||
GdkEvent *event,
|
|
||||||
gpointer data)
|
|
||||||
{
|
{
|
||||||
GtkWidget *popup, *da;
|
GtkWidget *popup, *da;
|
||||||
|
|
||||||
@ -59,7 +57,7 @@ main (int argc, char *argv[])
|
|||||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||||
|
|
||||||
g_signal_connect (window, "destroy", gtk_main_quit, NULL);
|
g_signal_connect (window, "destroy", gtk_main_quit, NULL);
|
||||||
g_signal_connect (window, "map-event", G_CALLBACK (on_map_event), NULL);
|
g_signal_connect (window, "map", G_CALLBACK (on_map), NULL);
|
||||||
|
|
||||||
gtk_widget_show (window);
|
gtk_widget_show (window);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user