I might could be approaching this situation incorrectly, so let me know if you 
have any suggestions.

My program has a text_display and a run button with a callback.  Here's what 
I'm trying to do:

//This is all written within the run button's callback (could that be the 
problem?)
1. When I do a callback I display some text (such as: "Running command...")
2. Then AFTER it displays the text, I run a few system commands and return the 
status
3. Once it's done I inform the user of the status (Success/Failure) by sending 
text to the text display again.

Here's the problem: the text display doesn't display anything until the entire 
callback is finished, so everything comes out all at once.

I've tried using a sleep function, and the redraw() function with no luck. I've 
also writing a separate function for the system calls which is invoked by the 
button's callback.  Here's a simple version of my callback:

void runbutt_cb(Fl_Widget *runbutt, void *data)
{
        textout->insert("Checking packages for compile errors...\n");

        const char* cmd = "some system command";
        makestatus = system(cmd);

        if (makestatus == 0) textout->insert("\nNo compiling errors found.\n");
        else textout->insert("\nErrors found.\n");
}

Is there a way to update a text display before the callback has finished?  
Thanks in advance!

Ben
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to