Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • by jozef (8299) on 2009.05.16 8:39 (#68593) Homepage Journal

    Why is the module Gtk2::Unique? Shouldn't the libunique work for all app types even if not using Gtk2? I don't write Gtk2 applications but it will be interesting to have a common easy way how to make sure scripts are running just once. Like cron jobs, etc. Is this possible with libunique and/or Gtk2::Unique?

    • Why is the module Gtk2::Unique?

      Because libunique requires gtk+.

    • The module is in the prefix Gtk2 because that's was suggested in the perl-gtk IRC channel. The name was even proposed by the creator of libunique.

      Nevertheless, the namespace is not a sign of the dependencies required but more of where the module belongs to. Although this particular module does require that an application is given a Gtk2::Window handle. I haven't looked at the C library so I don't really know why this is needed. I will ask the creator of the C library why is a Gtk2::Window handle required.

      • I got a reply from libunique's creator. The purpose of the library is truly to help GUI based programs to ensure an unique instance. Since it is aimed at GUIs the default implementation of libunique provides some custom actions that apply only to a GUI (ex: bring forwards the main window of the application when a message is received).

        A command line application that would like to have the same benefits could either use D-Bus and try to register a service name. Service names are unique in D-Bus. Another appro