[gtk-list] GAG and threads




Daniel Skarda writes:
 >     Shall I use threads (I have to say that for me using thread is "hic sunt
 > leones") - or there is another (simplier, smarter, cleaner, small effort, small
 > overhead... ) way to make "interupt preview button" and keep gtk vigilant
 > even though program performs "heavy computations"?

You could process a few lines of your preview, go into the event
handler to check if there are any GTK events pending (eg. the cancel
button has been pressed!), process a few more lines, go into the event
handler, process a few more lines, go into the event handler, process
a few more lines, go into the event handler, process a few more lines,
go into the event handler, process a few more lines, go into the event
handler, process a few more lines, go into the event handler, process
a few more lines, go into the event handler, process a few more lines,
go into the event handler, process a few more lines, go into the event
handler, process a few more lines, go into the event handler, process
a few more lines, uhh... you get the idea.

--Adam



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]