Re: Why does not my statusbar msg's display in time ?

On Thu, 29 Jun 2000, Magnus [iso-8859-1] Wirström wrote:

> Hi Again !!!
> I have a problem .... I am trying to get a message in a statusbar before
> I am calling a system() command... well ... it looks something like this
> :
> ....
>     gnome_app_flash(GNOME_APP(app), "Message");
>     system("consol command");
> ....
> Well... this should not be a problem... but the consol command I am
> running is taking some time to execute so I want the message to be
> displayed before it runs it. In some way it ends up in not displaying
> the message before it execute the system() command, but after it instead
> ... do anyone have an idea why ? or another way to do this that might
> work better ? Or should I put some kind of delay in there before I run
> the system() command? I tried sleep(10); but it didn't work !

Are you sure you want to use system()?  You do know that your app won't be
able to do anything while the command you ran with system() is running,
don't you (this includes redrawing if part of the app gets
obscured).  Maybe you should look at using fork() and exec() to start the
program, along with a SIGCHLD handler to catch its death (at which point
you use wait() to clean it up).

> Thanks =)
> /Magnus
> ICQ 5077127
> --
> Magnus Wirström
> Alien Software Development
> Linux developer



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