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

use Perl Log In

Log In

[ Create a new account ]

potyl (8582)

  (email not shown publicly)

Journal of potyl (8582)

Wednesday May 06, 2009
12:20 AM

Plenty of new releases Gtk2:: goodies

[ #38928 ]

This last month has been a busy period and I managed somehow to work on 3 Gtk2 based CPAN bundles: Champlain, Gtk2::Ex::Entry::Pango and a new module Gtk2::Unique.

In the past weeks someone was looking for the Perl bindings to libunique (a library for writing single instance applications). The bindings didn't exist so I decided to write them as they can be quite useful and might end-up being used one day in Xacobeo.

This project took a little longer than I expected even though the C API is quite small (3 header files). I got delayed considerably because I'm still learning how to write proper GObject bindings. The important thing is that the module has been released and is now in CPAN Gtk2::Unique

In the meanwhile I also managed to release a new version of Gtk2::Ex::Entry::Pango which is backward compatible with all versions of Gtk2 that support Pango and most important behaves correctly when the text entry gains focus. Now when default Pango markup is used to display text when the widget is empty it will clear the default text when the focus is gained and restore it when focus is lost (if there's no text). This is similar to what Firefox's search bar is doing and apparently Windows Vista (I don't have it so I can't tell).

Lastly but not the least, libchamplain had a major release (0.3). The number of improvements and additions is too long to be enumerated in this post. One thing is assured the library is getting better and better. This new version has a lot of API changes, this is for the best so bare with us. The bad thing is that the API changes where so numerous that the bindings are lagging behind. Don't worry it's just a question of time and the bindings will be ready soon.

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.
  • 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