Re: gtk_progress_bar_pulse() doesn't work?



On Thu, Aug 02, 2001 at 05:43:52PM +0400, Vitaly Tishkov wrote:
> Hi,
> 
> It seems to me that gtk_progress_bar_pulse () does nothing.
> The test case is below. As far as I understand new_fraction in the test case
> should be 0.8 but not 0.2.
> 
> Is it a bug in GtkProgressBar or my test case is incorrect?

	IIRC, pulse and fraction are orthogonal concepts.  If you are
running pulse(), there is no fraction, because the 'filled' part is not
from 0->current.  IOW:

fraction = 0.8

[########--]

pulse

[-----###--]

	A pulse is not "updated by this step", it is a state for "I have
no idea what percentage I'm at, so just show some activity, any
activity".  So you should not expect pulse() to update the fraction.  I
believe that the behavior you are looking for is:

> #include <gtk/gtk.h>
> 
> int
> main (int argc, char** argv)
> {
>     GtkWidget *widget;
> 
>     gtk_init (&argc, &argv);
> 
>     widget = gtk_progress_bar_new ();
> 
>     gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (widget), 0.2);
>     gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (widget), 0.5);
>     gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (widget), 0.8);
> 
>     printf ("new_fraction = %lf\n",
>            gtk_progress_bar_get_fraction (GTK_PROGRESS_BAR (widget)));
> 
>     gtk_widget_destroy (widget);
>     return 0;
> }
> 
> Output:
> new_fraction = 0.800000

Joel

-- 

Life's Little Instruction Book #237

	"Seek out the good in people."

			http://www.jlbec.org/
			jlbec evilplan org




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