home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Editores / Perl5 / perl / lib / site / Tk / demos / LabEnLabRad.pm
Encoding:
Perl POD Document  |  1997-08-10  |  1.4 KB  |  38 lines

  1. package Tk::LabeledEntryLabeledRadiobutton;
  2. require Tk::Frame;
  3. @ISA = qw(Tk::Frame);
  4.  
  5. require Tk::LabEntry;
  6. require Tk::LabRadio;
  7.  
  8. Construct Tk::Widget 'LabeledEntryLabeledRadiobutton';
  9.  
  10. sub Populate
  11. {
  12.  
  13.     # LabeledEntryLabeledRadiobutton(s) constructor.
  14.     #
  15.     # Advertised subwidgets:  labeled_entry, labeled_radiobutton.
  16.  
  17.     my($cw, $args) = @_;
  18.  
  19.     my $e = $cw->Component(LabEntry => 'labeled_entry');
  20.     $e->pack(-side => 'left', -expand => 1, -fill => 'both');
  21.  
  22.     my $r = $cw->Component(LabRadiobutton => 'labeled_radiobutton',
  23.                            -radiobuttons   => delete $args->{'-radiobuttons'}
  24.                           );
  25.     $r->pack(-side => 'left', -expand => 1, -fill => 'both');
  26.     $cw->ConfigSpecs(-entry_label    => [ Tk::Configure->new($e,'-label'), undef, undef, 'Entry' ],
  27.                      -radio_label    => [ Tk::Configure->new($r,'-label'), undef, undef, Choose ],
  28.                      -entry_variable => [ Tk::Configure->new($e,'-textvariable'), undef, undef, \$cw->{Config}{-text} ],
  29.                      -radio_variable => [ Tk::Configure->new($r,'-variable'), undef, undef, undef ],
  30.                      -indicatoron    => [ 'labeled_radiobutton' , undef, undef, undef ],
  31.                      DEFAULT         => [ ['labeled_entry','labeled_radiobutton']],
  32.                     );
  33.     $cw->Delegates(DEFAULT => 'labeled_entry');
  34.  
  35. } # end LabeledEntryLabeledRadiobutton(s) constructor
  36.  
  37. 1;
  38.