| 1 |
#!/usr/bin/perl |
| 2 |
|
| 3 |
=head1 NAME |
| 4 |
|
| 5 |
Debconf::Element::Gnome::Note - a note to show to the user |
| 6 |
|
| 7 |
=cut |
| 8 |
|
| 9 |
package Debconf::Element::Gnome::Note; |
| 10 |
use warnings; |
| 11 |
use strict; |
| 12 |
use Debconf::Gettext; |
| 13 |
use Gtk3; |
| 14 |
use utf8; |
| 15 |
use Debconf::Encoding qw(to_Unicode); |
| 16 |
use Debconf::Element::Noninteractive::Note; |
| 17 |
use base qw(Debconf::Element::Gnome); |
| 18 |
|
| 19 |
=head1 DESCRIPTION |
| 20 |
|
| 21 |
This is a note to show to the user. |
| 22 |
|
| 23 |
=cut |
| 24 |
|
| 25 |
sub init { |
| 26 |
my $this=shift; |
| 27 |
my $extended_description = to_Unicode($this->question->extended_description); |
| 28 |
|
| 29 |
$this->SUPER::init(@_); |
| 30 |
$this->multiline(1); |
| 31 |
$this->fill(1); |
| 32 |
$this->expand(1); |
| 33 |
$this->widget(Gtk3::HBox->new(0, 0)); |
| 34 |
|
| 35 |
my $text = Gtk3::TextView->new(); |
| 36 |
my $textbuffer = $text->get_buffer; |
| 37 |
$text->show; |
| 38 |
$text->set_wrap_mode ("word"); |
| 39 |
$text->set_editable (0); |
| 40 |
|
| 41 |
my $scrolled_window = Gtk3::ScrolledWindow->new(); |
| 42 |
$scrolled_window->show; |
| 43 |
$scrolled_window->set_policy('automatic', 'automatic'); |
| 44 |
$scrolled_window->set_shadow_type('in'); |
| 45 |
$scrolled_window->add ($text); |
| 46 |
|
| 47 |
$this->widget->show; |
| 48 |
$this->widget->pack_start($scrolled_window, 1, 1, 0); |
| 49 |
|
| 50 |
$textbuffer->set_text($extended_description); |
| 51 |
|
| 52 |
$this->widget->show; |
| 53 |
$this->adddescription; |
| 54 |
$this->addwidget($this->widget); |
| 55 |
# No help button is added since the widget is the description. |
| 56 |
} |
| 57 |
|
| 58 |
=head1 AUTHOR |
| 59 |
|
| 60 |
Eric Gillespie <[email protected]> |
| 61 |
Gustavo Noronha Silva <[email protected]> |
| 62 |
|
| 63 |
=cut |
| 64 |
|
| 65 |
1 |