Looping with zenity's progress bar

Hi, me again :}

I do have a little issue with my pseudo code. I am trying to copy files from one place to another and show the progress bar of the task, however the progress will start on 0% and change its GUI to 100% immediately (there is no progress on the bar), files were copied to desired location, I did not have issue with that.

Do you have any advice?

PSeudo code

#!/bin/bash

cd ~
for file in *.txt
do
echo "$file"
cp ${file} ~/test
sleep 0.1
done | zenity --progress --title="TXT" --text="uploading" --percentage="0"

It was 4 years ago when I touched the zenity command. If I recall, you have to echo the number and pipe it to the zenity command.

something like this

( for i in `seq 1 100`; do echo $i; sleep 0.1; done ) | zenity --progress