home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / perl5 / Debconf / Element / Gnome / Boolean.pm next >
Encoding:
Perl POD Document  |  2006-07-24  |  684 b   |  41 lines

  1. #!/usr/bin/perl -w
  2. # This file was preprocessed, do not edit!
  3.  
  4.  
  5. package Debconf::Element::Gnome::Boolean;
  6. use strict;
  7. use Gtk2;
  8. use utf8;
  9. use Debconf::Encoding qw(to_Unicode);
  10. use base qw(Debconf::Element::Gnome);
  11.  
  12.  
  13. sub init {
  14.     my $this=shift;
  15.     my $description=to_Unicode($this->question->description);
  16.     
  17.     $this->SUPER::init(@_);
  18.     
  19.     $this->widget(Gtk2::CheckButton->new($description));
  20.     $this->widget->show;
  21.     $this->widget->set_active(($this->question->value eq 'true') ? 1 : 0);
  22.     $this->addwidget($this->widget);
  23.     $this->tip( $this->widget );
  24.     $this->addhelp;
  25. }
  26.  
  27.  
  28. sub value {
  29.     my $this=shift;
  30.  
  31.     if ($this->widget->get_active) {
  32.         return "true";
  33.     }
  34.     else {
  35.         return "false";
  36.     }
  37. }
  38.  
  39.  
  40. 1
  41.