linux thread / gtk draw
Posted: Mon Jun 11, 2007 11:18 pm
Hello, i've some question on processing long loop and updating the gui.
when i put long loop in principal thread, i use
it is working, the gui is updated but sometimes blocked until the current hash is finished and it appears that the cpu is 100% charged, i think the response is in thread but how to update the gui ? with a timer ? ugly...
when i put long loop in principal thread, i use
Code: Select all
While (gtk_events_pending_ ())
gtk_main_iteration_ ();
WendCode: Select all
Directory$ = "/home/fred/"
If ExamineDirectory(0, Directory$, "*.*")
While NextDirectoryEntry(0)
If DirectoryEntryType(0) = #PB_DirectoryEntry_File
md5$ = MD5FileFingerprint(Directory$+DirectoryEntryName(0))
AddGadgetItem(#gadget_Main_ListIcon_Files, -1,md5$)
While (gtk_events_pending_ ())
gtk_main_iteration_ ();
Wend
EndIf
Wend
FinishDirectory(0)
EndIf