linux thread / gtk draw

Linux specific forum
frederic
User
User
Posts: 56
Joined: Thu Jan 05, 2006 11:22 pm

linux thread / gtk draw

Post by frederic »

Hello, i've some question on processing long loop and updating the gui.

when i put long loop in principal thread, i use

Code: Select all

While (gtk_events_pending_ ())
     gtk_main_iteration_ ();
Wend
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...

Code: 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