home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / perl5 / Debconf / Element / Gnome / Error.pm < prev    next >
Encoding:
Perl POD Document  |  2009-03-24  |  1.1 KB  |  52 lines

  1. #!/usr/bin/perl -w
  2. # This file was preprocessed, do not edit!
  3.  
  4.  
  5. package Debconf::Element::Gnome::Error;
  6. use strict;
  7. use Debconf::Gettext;
  8. use Gtk2;
  9. use utf8;
  10. use Debconf::Encoding qw(to_Unicode);
  11. use base qw(Debconf::Element::Gnome);
  12.  
  13.  
  14. sub init {
  15.     my $this=shift;
  16.     my $extended_description = to_Unicode($this->question->extended_description);
  17.  
  18.     $this->SUPER::init(@_);
  19.     $this->multiline(1);
  20.     $this->fill(1);
  21.     $this->expand(1);
  22.     $this->widget(Gtk2::HBox->new(0, 0));
  23.  
  24.     my $image = Gtk2::Image->new_from_stock("gtk-dialog-error", "dialog");
  25.     $image->show;
  26.  
  27.     my $text = Gtk2::TextView->new();
  28.     my $textbuffer = $text->get_buffer;
  29.     $text->show;
  30.     $text->set_wrap_mode ("word");
  31.     $text->set_editable (0);
  32.  
  33.     my $scrolled_window = Gtk2::ScrolledWindow->new();
  34.     $scrolled_window->show;
  35.     $scrolled_window->set_policy('automatic', 'automatic');
  36.     $scrolled_window->set_shadow_type('in');
  37.     $scrolled_window->add ($text);
  38.  
  39.     $this->widget->show;
  40.     $this->widget->pack_start($image, 0, 0, 6);
  41.     $this->widget->pack_start($scrolled_window, 1, 1, 0);
  42.  
  43.     $textbuffer->set_text($extended_description);
  44.  
  45.     $this->widget->show;
  46.     $this->adddescription;
  47.     $this->addwidget($this->widget);
  48. }
  49.  
  50.  
  51. 1
  52.