Weirdness with GTK+-1.2.8 ?



Hi,


This seems to be a bug:

This code...

gint more_cb (GtkWidget *button, GtkProgress *pbar)
{
        gfloat perc;
	gint count;
	
	perc = 0.0;
	gtk_progress_set_percentage (pbar, 0.0);

	while (perc < 1.0) {
		usleep (50);
		printf ("%f %d\n", perc, (perc < 1.0));
		gtk_progress_set_percentage (pbar, perc+.02);
		perc = gtk_progress_get_current_percentage (pbar);
		while (gtk_events_pending ())
			gtk_main_iteration ();
	}

	return FALSE;
}

...produces this output:

...
0.920000 1
0.930000 1
0.940000 1
0.950000 1
0.960000 1
0.970000 1
0.980000 1
0.990000 1
1.000000 1

Gtk-CRITICAL **: file gtkprogress.c: line 518 (gtk_progress_set_percentage): assertion `percentage >= 0 && percentage <= 1.0' failed.
1.000000 1

Gtk-CRITICAL **: file gtkprogress.c: line 518 (gtk_progress_set_percentage): assertion `percentage >= 0 && percentage <= 1.0' failed.
1.000000 1

Gtk-CRITICAL **: file gtkprogress.c: line 518 (gtk_progress_set_percentage): assertion `percentage >= 0 && percentage <= 1.0' failed.
1.000000 1


I can't understand why (perc < 1.0) when perc = 1.000000.
And if perc < 1.0, why does GTK+ complain that percentage is not <= 1.0.



Wolfgang
-- 
A chicken is an egg's way of producing more eggs.




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