Jerome Quelin > Tk-Sugar-1.093190 > Tk::Sugar

Download:
Tk-Sugar-1.093190.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 1.093190   Source  

NAME ^

Tk::Sugar - Sugar syntax for Tk

VERSION ^

version 1.093190

SYNOPSIS ^

    use Tk::Sugar qw{ :pack :state };

    $widget->pack( top, xfill2, pad10 );
    # equivalent to those pack options:
    #     -side   => 'top'
    #     -expand => 1
    #     -fill   => 'both'
    #     -padx   => 10
    #     -pady   => 10

    $widget->configure( enabled );
    # equivalent to: -state => 'enabled'

DESCRIPTION ^

Tk is a great graphical toolkit to write desktop applications. However, one can get bothered with the constant typing of quotes and options. Tk::Sugar provides handy subs for common options used when programming Tk.

Benefits are obvious:

EXPORTS ^

This module is using Sub::Exporter underneath, so you can use all its shenanigans to change the export names.

Exported subs

Look below for the list of available subs.

Pack options

Traditional packer sides (available as :side export group):

Packer expand and filling (available as :fill export group):

Packer padding (available as :pad export group):

Packer padding (available as :ipad export group):

Common options

Widget state (available as :state export group):

Widget anchor (available as :anchor export group). Note that those subs are upper case, otherwise the sub s would clash with the regex substitution:

Widget orientation (available as :orient export group).:

Export groups

Beside the individual groups outlined above, the following export groups exist for your convenience:

:default

This exports all existing subs.

:pack

This exports subs related to Tk::pack options. Same as :side, :fill, :pad and :ipad.

:options

This exports subs related to widget configure options. Same as :state, :anchor and :orient.

SEE ALSO ^

You can look for information on this module at:

AUTHOR ^

  Jerome Quelin

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2009 by Jerome Quelin.

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

syntax highlighting: