| View previous topic :: View next topic |
| Author |
Message |
neters
Joined: 04 Jan 2006 Posts: 5
|
Posted: Wed Jan 25, 2006 4:18 pm Post subject: Flushing a GtkTextBuffer |
|
|
I have a function that takes some time to complete and would like to have a status window to indicate progress. The function is in a foreach loop and during each iteration and I send a message to the buffer.
I'm using a GtkTextBuffer->insert_at_cursor() and everything works fine except that no output is visible until after the function is completed.
I've tried using flush() and ob_flush() to no avail. What am I doing wrong here?
Thanks |
|
| Back to top |
|
 |
karlbowden
Joined: 18 Dec 2005 Posts: 21 Location: Taree, NSW, Australia
|
Posted: Wed Jan 25, 2006 4:28 pm Post subject: |
|
|
If it's a cpu intensive operation you might try adding:
| Code: | while (gtk::events_pending())
gtk::main_iteration();
|
into the foreach loop |
|
| Back to top |
|
 |
neters
Joined: 04 Jan 2006 Posts: 5
|
Posted: Wed Jan 25, 2006 4:44 pm Post subject: |
|
|
| That works perfectly.. thanks Karl. |
|
| Back to top |
|
 |
|