http://qs321.pair.com?node_id=991032


in reply to Perl Gtk3 Tutorial

Your code examples look nice to my eyes. You might want to post this on the gtk-perl maillist as other people are also working on tutorials and examples for Gtk3.

Before anyone gets too excited, Perl/Gtk3 is far from ready for use. The automatic documentaion generation of Gtk2, is no longer there. So there are NO docs for Perl. How are you going to expect people to work on something with no docs?

From Torsten Schoenfeld, the Perl Gtk3 leader:

There's indeed no Perl-specific documentation yet, and I'm not inclined to write it. All the necessary information is available on <http://developer.gnome.org/gtk3/stable/> and in the file "<prefix>/share/gir-1.0/Gtk-3.0.gir". A nice little project might be to write a viewer for all the information in the *.gir files (which include the actual documentation that ends up on developer.gnome.org). It could use Perl-specific syntax so people don't have to do the translation in their head. I definitely do not consider Gtk3 "finished" yet. We no doubt still miss quite a few overrides, and there are one or two low-level problems left.

You'd have to add Perl support. From the looks of it, you'd have to extend <http://git.gnome.org/browse/gobject-introspection/tree/giscanner/mallardwriter.py> to include a MallardFormatterPerl class and add mallard-Perl-*.tmpl files. You could most likely borrow heavily from the existing Python stuff.

> Does this mean for Perl, we would have to make an xml
> parser, and convert Gtk-3.0.gir to a hash, then make a viewer
> for it?

That would be another option. Note that you don't have to write an XML parser yourself; there are lots on CPAN.


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Replies are listed 'Best First'.
Re^2: Perl Gtk3 Tutorial
by kevinp (Novice) on Sep 02, 2012 at 17:41 UTC

    Torsten,

    Thanks for the comments. I will post on gtk-perl and continue adding examples and writing up the notes. The aim isn't to be comprehensive but to get somebody started who has little experience programming GUI's in Perl. Its also something I can add to and improve over time.

Re^2: Perl Gtk3 Tutorial
by wazoox (Prior) on Sep 05, 2012 at 20:15 UTC
    By the way there never was any real Gtk2 perl documentation, either. I've had to extrapolate from the C docs and books...
      Sure, you can do perldoc Gtk2::TextView, for instance, and get the automatically generated doc for the TextView widget. See Gtk2 TextView doc

      What is needed now is an XML guru who will parse the Gtk3 gir file, extract all the elements, and display it in a nice table.


      I'm not really a human, but I play one on earth.
      Old Perl Programmer Haiku ................... flash japh
        Well, yes, that's fine as a pure reference documentation, however as a tutorial it's somewhat lacking :)