Esempio n. 1
0
static gboolean do_scroll_event(GtkTreeView *tv, GdkEventScroll *e)
{
	gint x, y, cx;
	GtkTreeViewColumn *col;

	gtk_tree_view_widget_to_tree_coords(tv, e->x, e->y, &x, &y);
	if (!gtk_tree_view_get_path_at_pos(tv, x, y, NULL, &col, &cx, NULL))
		return FALSE;
	if (col != g_object_get_data(G_OBJECT(tv), "signalcol"))
		return FALSE;

	switch (e->direction) {
	case GDK_SCROLL_UP:
		sigview_zoom(GTK_WIDGET(tv), 1.2, cx);
		break;
	case GDK_SCROLL_DOWN:
		sigview_zoom(GTK_WIDGET(tv), 1/1.2, cx);
		break;
	default:
		/* Surpress warning about unswitch enum values */
		break;
	}
	
	return TRUE;
}
Esempio n. 2
0
void zoom_fit(GtkAction *action, GObject *parent)
{
	(void)action;

	GtkWidget *sigview = g_object_get_data(parent, "sigview");
	sigview_zoom(sigview, 0, 0);
}
Esempio n. 3
0
static void col_resized(GtkWidget *col)
{
	sigview_zoom(col, 1, 0);
}