Jeffrey Ray Hallock > Gapp > Gapp::Moose::Role

Download:
Gapp-0.60.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.60   Source  

NAME ^

Gapp::Moose::Role - Gapp widgets for your roles

SYNOPSIS ^

  package Foo::Bar;
 
  use Gapp::Moose::Role;

  widget 'label' => (

    is => 'ro',

    traits => [qw( GappLabel )],

    construct => sub {

        text => 'Hello World!'

    }

  );

  widget 'window' => (

    is => 'ro',

    traits => [qw( GappWindow GappDefault )],

    construct => sub {

        title => 'Gapp Application',
    
        content => [ $_[0]->label ],
    
        signal_connect => [

            [ 'delete-event' => sub { Gtk2->main_quit } ]
    
        ],

    },

  );

  ... and then later ...

  package main;

  Foo::Bar->new->show_all;

  Gapp->main;

DESCRIPTION ^

Gapp::Moose::Role provides sugar for adding Gapp widgets to your Moose roles.

SUGAR ^

widget

Internally, this calls &Moose::Role::has to create a new attribute with the GappWidget trait applied.

Alternatively, you could apply the GappWidget trait yourself

 has 'widget' => (
    traits => [qw( GappWidget )],
 );

AUTHORS ^

Jeffrey Ray Hallock, <jeffrey dot hallock at gmail dot com>

COPYRIGHT & LICENSE ^

Copyright 2011 Jeffrey Ray Hallock, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: