Re: [gtk-list] Re: Changing gtkadjustment upper and lower values



> >>         Is there a simple method to change the upper and lower value of a
> >> GtkAdjustment?  The only method I can see is by accessing the upper and
> > How about gtk_adjustment_clamp_page ()?
> This doesn't seem to do anything for me here.  I'm using the adjustment with a
> spin button, and it just keeps spinning up to the initial limit i set when
> creating the adjustment.  I'm using gtk+ 1.2.0.  I have successfully reset its
> limits by accessing its values directly, but that doesn't seem to be proper OO
> to me.

>From the GTK+ tutorial:

	The first thing you should know is that there aren't any handy-dandy
	macros or accessor functions for getting the value out of a
	GtkAdjustment, so you'll have to (horror of horrors) do it like a
	real C programmer.

.... so I guess the same applies to setting the adjustment fields :-)

After you change the fields of the adjustment you have to tell the widget
that it has changed. You do this by calling:

	gtk_signal_emit_by_name(GTK_OBJECT(adjustment), "changed");

The spin button (as do other range widgets) has a signal handler connected
to the "changed" signal.

Allan



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