When will Gtk4 be coming to perl?

Hello!

Gtk4 has been out for a while, and I was wondering if there were any projects in the works to bring Gtk4 language bindings to perl?

Thanks

1 Like

Currently, there are no people working on a Gtk4 Perl module. It’s not exceedingly hard to just call into Glib::Object::Introspection and make a simple wrapper:

package Gtk4;

use strict;
use warnings;

use Glib::Object::Introspection;

use Exporter;

our @ISA = qw( Exporter );

sub import {
    my $class = shift;

    Glib::Object::Introspection->setup(
        basename => 'Gtk',
        version => '4.0',
        package => 'Gtk4',
    );

    Glib::Object::Introspection->setup(
        basename => 'Gdk',
        version => '4.0',
        package => 'Gtk4::Gdk',
    );

    Glib::Object::Introspection->setup(
        basename => 'Gsk',
        version => '4.0',
        package => 'Gtk4::Gsk',
    );
}

1;

The main issue is going to be the set of overrides needed to make the API more Perlish. Nevertheless, the shim above should suffice to get you started.

3 Likes

If you want to use GTK4 and libadwaita with Perl, I just wrote two modules:

I’ll keep noodling at them and publish them on CPAN.

4 Likes

Thanks for working on perl-Gtk4. Are you considering packaging it for some Linux distribs?

As the maintainer of GCstar based on Perl-Gtk2 or Perl-Gtk4, I’m interested in starting investigating a migration to GtK4, after checking that Windows and MacOS as still supported.

1 Like

I’m planning on adding some more overrides to make the API less C and more Perlish, and add some more tests; then I’ll upload the package to CPAN, and see if we can release it alongside the other GTK related Perl modules before GNOME 44 is out, next March.

GTK still supports Windows and macOS; the Perl bindings for GLib and GObject-introspection should also work fine on those platforms, as far as I know.

2 Likes

Good work! I’ll be in “monitoring” mode on the project in the next few months before considering anything serious.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.