POE::Session::GladeXML2 - emit POE events for Gtk2 callbacks


   package test;

   use POE::Session::GladeXML2;

   # the name of the sub needs to match with the name you entered in
   # the glade signal handler dialog.
   sub on_button1_clicked {
      print STDERR "button clicked\n";

   sub new {
      [... object creation ...]
      my $session = POE::Session::GladeXML2->create (
          glade_object => $self,
          glade_file => '',
          glade_args => 'widgetname',
          [... POE Session params ...]

      return $self;

   my $foo = test->new;


A simple helper module that lets you connect callback names from your .glade file with methods of an object. These methods are called as POE callback or postback methods. POE::Session::GladeXML automatically determines whether gtk expects the signal handler to return a value. If it does, a callback is used, otherwise a postback will be used.


create (%args)

creates a POE::Session that connects the callbacks from the glade file to the corresponding method of the object in the glade_object argument. The glade_file argument contains the name of the glade file to use. Optional arguments for Gtk::GladeXML->new are in the glade_args argument. See Gtk2::GladeXML for more information.

If you are using this to create your main window, you can put the name of that in a glade_mainwin argument, which will then be used to make POE exit when this window is closed.


gladexml ()

Returns the Gtk2::GladeXML object.


POE::Session and Gtk2::GladeXML


Martijn van Beers <>


This module is free software; you may reproduce and/or modify it under the terms of the GPL license v2.0. See the file LICENSE in the source tarball for more information


This module wouldn't be half as good without the invaluable advice of Rocco Caputo and Scott Arrington.