A little GTK trick that may help

Post Reply
User avatar
xProgrammer
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

A little GTK trick that may help

Post by xProgrammer »

I came across this GTK trick whilst writing xHarbour code to compile and link am xHarbour application. I was (trying to) update a status bar as each module was compiled and linked, but all I ever saw was the final message. GTK event processing can get queued up behind other processes which consume lots of processor time and may have higher assigned priorites (or something like that). The trick is to execute the following after updating the status bar:

HB_FUNC( PROCESS_PENDING_GTKH_EVENTS )
{
while( gtk_events_pending() )
gtk_main_iteration();
}

If you ever run into this type of problem the above just might be the answer.

Regards
Doug
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: A little GTK trick that may help

Post by Antonio Linares »

Doug,

You can use FiveLinux function SysRefresh(), as it does the same :-)

We use the same name SysRefresh() as in FiveWin, to keep coherence between different versions :-)

Anyhow, many thanks for your kind and interesting sharings as usual
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply