Web lists-archives.com

Re: GTK Queue Draw Subtle Question


   Thanks for the response!

   The long running function involves repeatedly loading data from a disk cache and if necessary the internet
based on a user selected list of Stock Ticker Symbols. Then once loaded performing a modest amount of
processing, and then display. Most of the latency by far is caused by the Internet server loads.

   The previous response mentioned a thread based solution which sounds interesting. Where the long latency
read will be moved off to a separate thread which ends in a gtk_widget_queue_draw of its own. What do you

Thomas Dineen

On 2/17/2017 10:41 AM, cecashon@xxxxxxx wrote:

Hi Thomas,

What is in your long running function? Are there calls to GTK/GDK functions? Is it calculating a long running math function for a simulation? Complex drawing, etc?

GTK has a few different ways to help out with long running functions depending on what the code is doing. A little more info would help to target a good solution.


-----Original Message-----
From: Thomas Dineen <tdineen@xxxxxxxxxxxxx>
To: gtk-list <gtk-list@xxxxxxxxx>; tdineen <tdineen@xxxxxxxxxxxxx>
Sent: Wed, Feb 15, 2017 2:41 pm
Subject: GTK Queue Draw Subtle Question

Gentle People:

I have a rather large project in progress based on the GTK2/Cairo
Which brings me to the following question about gtk_widget_queue_draw:
For each Menu Function, meaning a C function, which is called by a menu
event handle,
in response to a Menu Selection. I place a gtk_widget_queue_draw at the
end of the function
to cause the screen to update in response to the command. Learned
behavior from examples
and experience. This seems to work great.

Now the question: If the menu function is complex, requiring seconds or
minutes to execute
the screen freezes or if windows are moved fails to update and we are
left with a default
grey screen. Is there any way to cause a queue draw and screen up date
from within this
long latency function.

My experience indicates that calling gtk_widget_queue_draw from within
this long latency
function dose not cause a screen update.

Thomas Dineen

gtk-list mailing list

gtk-list mailing list