GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TK::ROLE::HASWIDGETS (3)

.ds Aq ’

NAME

Tk::Role::HasWidgets - keep track of your tk widgets

CONTENTS

VERSION

version 1.112380

SYNOPSIS



    package Your::Tk::Window::Class;

    use Moose;
    with Tk::Role::HasWidgets;

    # store a button
    $self->_set_w( my_button => $button );

    # later on, in one of the methods
    $self->_w( my_button )->configure( ... );

    # when no longer needed:
    $self->_del_w( my_button );



DESCRIPTION

When programming Tk, it’s almost always a good idea to keep a reference to the widgets that you created in the interface. Most of the time, a simple hash is enough; but it is usually wrapped up in methods to make the hash private to the window object. And of course, those methods are duplicated in all modules, under a form or another.

Since duplication is bad, this module implements a Moose role implementing those methods once and forever. This implies that your class is using Moose in order to consume the role.

    About the method names

The methods featured in this role begin with _, that is, they are following Perl convention of private methods. This is on purpose: remember that this method is a role, consumed by your class. And you don’t want those methods to be available outside of the window class, do you?

METHODS

    _set_w



    $object->_set_w( $name, $widget );



Store a reference to $widget and associate it to $name.

    _w



    my $widget = $object->_w( $name );



Get back the $widget reference associated to $name.

    _del_w



    $object->_del_w( $name );



Delete the $name reference to a widget.

    _clear_w

Empty the widget references.

SEE ALSO

You can look for information on this module at:
o Search CPAN

<http://search.cpan.org/dist/Tk-Role-HasWidgets>

o See open / report bugs

<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Tk-Role-HasWidgets>

o Git repository

<http://github.com/jquelin/tk-role-haswidgets>

o AnnoCPAN: Annotated CPAN documentation

<http://annocpan.org/dist/Tk-Role-HasWidgets>

o CPAN Ratings

<http://cpanratings.perl.org/d/Tk-Role-HasWidgets>

AUTHOR

Jerome Quelin

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 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.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TK::ROLE::HASWIDGETS (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.