[CentOS] question on zenity centos 5

Mon May 21 20:58:36 UTC 2007
Jerry Geis <geisj at pagestation.com>

I am trying to use zenity --progress.

When I use this script:
#!/bin/sh
(
echo "10" ; sleep 1
echo "20" ; sleep 1
echo "50" ; sleep 1
echo "75" ; sleep 1
echo "100" ; sleep 1
) | zenity --progress
~

It works fine...

When I use a little program.
                for(count = 0; count <= 100; count += 10)
                        {
                        printf(stdout, "%d\n", count);
                        sleep(1);
                        }

and run it as "myprog | zenity --progress"
I dont get anything updating until the end and the program exits.

Why does the second example not work. Both
are just piping stdout into zenity. Both use carriage return.

Thanks,

Jerry