Re: Regarding activating window.

>Is there a way to activate an executable which is already running. I use
>3 buttons to launch 3 applications. I am using the system function to do
>that. Since the system function doesn't come out before the executable
>finishes, I am running them as background jobs in system. So when I
>press each button, every time a new instance of that executable comes up
>and the older ones remain behind. I don't the button to launch new
>instance of executable every time. first time I press a button, It
>should launch the application(executable), next time I press the same
>button, It should just bring the executable already running front ie.
>activate that executable instead of launching a new instance of that .
>How can I do this ??

you seem rather confused in your use of terminology. i can't be
certain what you want to do, but it sounds as if you are talking about
raising windows to the top of the window manager window
stack. gdk_window_raise() is as close as you can get, but it has to be
called by the process that owns the window. to do this to another
process' window(s) requires the use of window-system specific
functions, and as far as i know, GTK/GDK does not support this at this
time. For X Window, you would need to use the ICCCM and the WM spec;
this would fail if someone moved your code to a non-X Window based
implementation of GTK/GDK.

on the other hand, your use of the system(3) function might be source
of part of your problem. you should probably read up on the fork(2)
and exec(2) functions (in your case, i would focus on execvp(2)).


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