From: Michael N. <mn...@sp...> - 2005-07-08 13:36:12
|
> I was wondering if there is a simple way using the GtkExtra library to > be able to click at a point in the graph and then by using cursors or > some other way to traverse from one point to the next and get the y & > x values as you go along. Using S-Lang as pseudo-code, add a signal handler for motion events ... = g_signal_connect(canvas,"motion_notify_event", ... to the canvas, and within the handler do something like gtk_widget_get_pointer(canvas, &x, &y); gtk_plot_get_point(plot, x, y, &x, &y); and display it how you wish, such as in a label gtk_label_set_text(label, sprintf("( %5.3f, %5.3f )", x, y)); HTH, -Mike |