home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Editores / Perl5 / perl / lib / site / auto / Tk / Widget / Palette.al < prev    next >
Encoding:
Text File  |  1997-08-10  |  1.3 KB  |  34 lines

  1. # NOTE: Derived from blib\lib\Tk\Widget.pm.  Changes made here will be lost.
  2. package Tk::Widget;
  3.  
  4. sub Palette
  5. {
  6.  my $w = shift->MainWindow;
  7.  unless (exists $w->{_Palette_})
  8.   {
  9.    my %Palette = ();
  10.    my $c = $w->Checkbutton();
  11.    my $e = $w->Entry();
  12.    my $s = $w->Scrollbar();
  13.    $Palette{"activeBackground"}    = ($c->configure("-activebackground"))[3] ;
  14.    $Palette{"activeForeground"}    = ($c->configure("-activeforeground"))[3];
  15.    $Palette{"background"}          = ($c->configure("-background"))[3];
  16.    $Palette{"disabledForeground"}  = ($c->configure("-disabledforeground"))[3];
  17.    $Palette{"foreground"}          = ($c->configure("-foreground"))[3];
  18.    $Palette{"highlightBackground"} = ($c->configure("-highlightbackground"))[3];
  19.    $Palette{"highlightColor"}      = ($c->configure("-highlightcolor"))[3];
  20.    $Palette{"insertBackground"}    = ($e->configure("-insertbackground"))[3];
  21.    $Palette{"selectColor"}         = ($c->configure("-selectcolor"))[3];
  22.    $Palette{"selectBackground"}    = ($e->configure("-selectbackground"))[3];
  23.    $Palette{"selectForeground"}    = ($e->configure("-selectforeground"))[3];
  24.    $Palette{"troughColor"}         = ($s->configure("-troughcolor"))[3];
  25.    $c->destroy;
  26.    $e->destroy;
  27.    $s->destroy;
  28.    $w->{_Palette_} = \%Palette;
  29.   }
  30.  return $w->{_Palette_};
  31. }
  32.  
  33. 1;
  34.