diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gtkext/gtkgraphdisplay.c | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/src/gtkext/gtkgraphdisplay.c b/src/gtkext/gtkgraphdisplay.c index 0865e04..72519a2 100644 --- a/src/gtkext/gtkgraphdisplay.c +++ b/src/gtkext/gtkgraphdisplay.c @@ -119,6 +119,9 @@ static gboolean gtk_graph_display_button_release(GtkWidget *, GdkEventButton *, /* Assure la suivi des déplacements de souris sur le composant. */ static gboolean gtk_graph_display_motion_notify(GtkWidget *, GdkEventMotion *, GtkGraphDisplay *); +/* Réagit à une fin de survol du support graphique. */ +static gboolean gtk_graph_display_on_leave_notify(GtkWidget *, GdkEventCrossing *, GtkGraphDisplay *); + /* Prépare l'affichage d'une astuce. */ static gboolean gtk_graph_display_query_tooltip(GtkWidget *, gint, gint, gboolean, GtkTooltip *, GtkGraphDisplay *); @@ -215,19 +218,21 @@ static void gtk_graph_display_init(GtkGraphDisplay *display) G_CALLBACK(gtk_graph_display_draw), display); g_signal_connect(G_OBJECT(display->support), "button-press-event", - G_CALLBACK(gtk_graph_display_button_press), display); + G_CALLBACK(gtk_graph_display_button_press), display); g_signal_connect(G_OBJECT(display->support), "button-release-event", - G_CALLBACK(gtk_graph_display_button_release), display); + G_CALLBACK(gtk_graph_display_button_release), display); g_signal_connect(G_OBJECT(display->support), "motion-notify-event", - G_CALLBACK(gtk_graph_display_motion_notify), display); + G_CALLBACK(gtk_graph_display_motion_notify), display); + g_signal_connect(G_OBJECT(display->support), "leave-notify-event", + G_CALLBACK(gtk_graph_display_on_leave_notify), display); g_signal_connect(G_OBJECT(display->support), "query-tooltip", - G_CALLBACK(gtk_graph_display_query_tooltip), display); + G_CALLBACK(gtk_graph_display_query_tooltip), display); g_object_set(G_OBJECT(display->support), "has-tooltip", TRUE, NULL); gtk_widget_add_events(display->support, GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - | GDK_POINTER_MOTION_MASK); + | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK); gtk_widget_show(display->support); @@ -660,6 +665,33 @@ static gboolean gtk_graph_display_motion_notify(GtkWidget *widget, GdkEventMotio /****************************************************************************** * * +* Paramètres : widget = composant GTK visé par l'opération. * +* event = informations liées à l'événement. * +* display = support maître à consulter. * +* * +* Description : Réagit à une fin de survol du support graphique. * +* * +* Retour : TRUE pour arrêter la propagation du signal, FALSE sinon. * +* * +* Remarques : - * +* * +******************************************************************************/ + +static gboolean gtk_graph_display_on_leave_notify(GtkWidget *widget, GdkEventCrossing *event, GtkGraphDisplay *display) +{ + if (display->hl_edge_index < display->edges_count) + { + display->hl_edge_index = display->edges_count; + gtk_widget_queue_draw(widget); + } + + return FALSE; + +} + + +/****************************************************************************** +* * * Paramètres : widget = composant GTK visé par l'opération. * * x = abscisse de la position du message. * * y = ordonnée de la position du message. * |