ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-tk
perl-tk
Ever wanted a Radioentry?
by Ala Qumsieh other posts by this author
May 9 2003 6:47PM messages near this date
Re: Nonmember submission: Chinese support for Perl/TK? | Re: example from Mastering Perl/Tk
Maybe not, but here's one anyway :)

--Ala

package Tk::Radioentry;

use strict;

use vars qw/$VERSION/;
$VERSION = 0.01;

use base qw/Tk::Frame/;
use Tk::widgets qw(Frame Radiobutton Entry);

Construct Tk::Widget 'Radioentry';

sub ClassInit {
    my ($class, $mw) = @_;
    $class-> SUPER::ClassInit($mw);
}

sub Populate {
    my ($self, $args) = @_;

    $self-> SUPER::Populate();

    my $p  = $self-> parent;
    my $r  = $p-> Radiobutton;
    my $e  = $p-> Entry;

    $self-> ConfigSpecs(
	       DEFAULT       =>  [$e],
	       -text         =>  [$r, qw/text Text/, ''],
	       -command      =>  [$r, qw/command Command/, undef],
	       -indicatoron  =>  [$r, qw/indicatorOn IndicatorOn/, 1],
	       -selectcolor  =>  [$r, qw/selectColor SelectColor/, undef],
	       -selectimage  =>  [$r, qw/selectImage SelectImage/, undef],
	       -state        =>  [[$e,$r], qw/state State normal/],
	       -variable     =>  [$r, qw/variable Variable/, undef],
	       -textvariable =>  [$e, qw/textVariable TextVariable/, undef],
	       -value        =>  [$r, qw/value Value/, undef],
	       -anchor       =>  [[$r, $e], qw/anchor Anchor/, undef],
	       );

    $_-> pack(qw/-side left -in/, $self) for $r, $e;

    $self-> Advertise(entry       => $e);
    $self-> Advertise(radiobutton => $r);

    $self-> Delegates($_ => $r) for qw/deselect flash invoke select/;
    $self-> Delegates(DEFAULT => $e);
}

1;

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved