Re: [gtk-list] setting scroll parameters



>  I would like to set the relevant parameters of a scrolledwindow
>  directly, mainly (for x and y respectively)
>  - the scrolling unit (=step_increment ?)
>  - the current position (=pos ?)
>  - the possible range (= upper/lower ?)
>  - the page unit (=page_increment)

You should do something similar to this:

	GtkWidget     *sw;
	GtkAdjustment *vadj, *hadj;
	
	... create scrolled window (sw) and stuff ...
	
	vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(sw));
	hadj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(sw));
	
	... modify the values in vadj and/or hadj ...
	
	gtk_signal_emit_by_name(GTK_OBJECT(vadj), "changed");
	gtk_signal_emit_by_name(GTK_OBJECT(hadj), "changed");

You modify the adjustments' values and then emit a "changed" signal on
them.  The scrolled window (and anything that is connected to that
signal) will catch it and adjust itself accordingly.

  Quartic



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]