CopyFile and Progressbar

Discuss GUI programming with the RapaGUI plugin here
Post Reply
walkero
Posts: 16
Joined: Fri Jul 29, 2022 11:59 pm

CopyFile and Progressbar

Post by walkero »

Hello guys.
I am having a RapaGUI window with a progressbar, which I am trying to fill up while CopyFile is copying files. I do this on Linux with Gnome 3.
I use the Callback for CopyFile, but it seems that while the CopyFile is working, although I get the right information in DebugMessages (copied and filesize), it seems that RapaGUI is freezed. I even get a Linux window that asks me to terminate the application, as it seems frozen.

Here is the callback I am using

Code: Select all

Function p_CopyCallback(msg)
	Switch msg.action
	Case #COPYFILE_STATUS:
		Local percent = Ceil(msg.copied / msg.filesize * 100)
		moai.Set("prgbarCopy", "Level", percent)
		DebugPrint("Now copying", FilePart(msg.source), "to", PathPart(msg.destination), ": ", msg.Copied, " of ", msg.Filesize)
	EndSwitch
	Return(False)
EndFunction
which I call like:

Code: Select all

CopyFile(FullPath(srcPath$, fname$), destPath$, {Callback = p_CopyCallback})
Currently, the progressbar get to 100 when the copy of the file is finished. It freezes there and then updates when the next copy is complete.
Does anyone know if I need to do something else to have it working properly, showing the progressbar moving while the file is copied?
Post Reply