Re:
- From: Michael Ekstrand <mekstran scl ameslab gov>
- To: sunzysjzri <sunzysjzri gmail com>
- Cc: "gtk-app-devel-list gnome org" <gtk-app-devel-list gnome org>
- Subject: Re:
- Date: Mon, 19 Mar 2007 09:32:04 -0500
On Mon, 2007-03-19 at 17:18 +0800, sunzysjzri wrote:
I want to know how to keep a unique instance of gtk application?
Many thanks
As far as I know, "not portably."
However, a Google search for `gtk application single instance' returns a
number of results, including a GtkUnique library.
On Unix, you could use DBus, Bonobo, lock files and UNIX domain sockets,
or some other inter-process communication mechanism. If you can depend
on DBus (runs whenever GNOME is running, and perhaps also KDE), then you
could give your app a simple DBus API to check whether an instance is
running and, if one is, wake it up and die rather than starting a new
copy. The GNOME libs may also have some functionality for this (I'm not
really sure; I just seem to have a vague-ish recollection of seeing that
somewhere).
On Windows, I have no idea...
- Michael
--
Michael Ekstrand
Research Assistant, Scalable Computing Laboratory
Goanna, compute cluster and InfiniBand network monitor tool:
http://www.scl.ameslab.gov/Projects/Monitor/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]