<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl
# This file was preprocessed, do not edit!


package Debconf::Element::Gnome;
use warnings;
use strict;
use utf8;
use Gtk3;
use Debconf::Gettext;
use Debconf::Encoding qw(to_Unicode);
use base qw(Debconf::Element);


sub init {
	my $this=shift;

	$this-&gt;hbox(Gtk3::VBox-&gt;new(0, 10));

	$this-&gt;hline1(Gtk3::HBox-&gt;new(0, 10));
	$this-&gt;hline1-&gt;show;
	$this-&gt;line1(Gtk3::VBox-&gt;new(0, 10));
	$this-&gt;line1-&gt;show;
	$this-&gt;line1-&gt;pack_end ($this-&gt;hline1, 1, 1, 0);

	$this-&gt;hline2(Gtk3::HBox-&gt;new(0, 10));
	$this-&gt;hline2-&gt;show;
	$this-&gt;line2(Gtk3::VBox-&gt;new(0, 10));
	$this-&gt;line2-&gt;show;
	$this-&gt;line2-&gt;pack_end ($this-&gt;hline2, 1, 1, 0);

	$this-&gt;vbox(Gtk3::VBox-&gt;new(0, 5));
	$this-&gt;vbox-&gt;pack_start($this-&gt;line1, 0, 0, 0);
	$this-&gt;vbox-&gt;pack_start($this-&gt;line2, 1, 1, 0);
	$this-&gt;vbox-&gt;show;

	$this-&gt;hbox-&gt;pack_start($this-&gt;vbox, 1, 1, 0);
	$this-&gt;hbox-&gt;show;

	$this-&gt;fill(0);
	$this-&gt;expand(0);
	$this-&gt;multiline(0);
}


sub addwidget {
	my $this=shift;
	my $widget=shift;

	if ($this-&gt;multiline == 0) {
	    $this-&gt;hline1-&gt;pack_start($widget, 1, 1, 0);
	}
	else {
	    $this-&gt;hline2-&gt;pack_start($widget, 1, 1, 0);
	}
}


sub adddescription {
	my $this=shift;
	my $description=to_Unicode($this-&gt;question-&gt;description);

	my $label=Gtk3::Label-&gt;new($description);
	$label-&gt;show;
	$this-&gt;line1-&gt;pack_start($label, 0, 0, 0);
}


sub addbutton {
	my $this=shift;
	my $text = shift;
	my $callback = shift;

	my $button = Gtk3::Button-&gt;new_with_mnemonic(to_Unicode($text));
	$button-&gt;show;
	$button-&gt;signal_connect("clicked", $callback);

	my $vbox = Gtk3::VBox-&gt;new(0, 0);
	$vbox-&gt;show;
	$vbox-&gt;pack_start($button, 1, 0, 0);
	$this-&gt;hline1-&gt;pack_end($vbox, 0, 0, 0);
}


sub create_message_dialog {
	my $this = shift;
	my $type = shift;
	my $title = shift;
	my $text = shift;

	my $dialog =
		Gtk3::Dialog-&gt;new_with_buttons(to_Unicode($title), undef,
		                               "modal", "gtk-close", "close");
	$dialog-&gt;set_border_width(3);

	my $hbox = Gtk3::HBox-&gt;new(0);
	$dialog-&gt;get_content_area-&gt;pack_start($hbox, 1, 1, 5);
	$hbox-&gt;show;

	my $alignment = Gtk3::Alignment-&gt;new(0.5, 0.0, 1.0, 0.0);
	$hbox-&gt;pack_start($alignment, 1, 1, 3);
	$alignment-&gt;show;

	my $image = Gtk3::Image-&gt;new_from_stock($type, "dialog");
	$alignment-&gt;add($image);
	$image-&gt;show;

	my $label = Gtk3::Label-&gt;new(to_Unicode($text));
	$label-&gt;set_line_wrap(1);
	$hbox-&gt;pack_start($label, 1, 1, 2);
	$label-&gt;show;

	$dialog-&gt;run;
	$dialog-&gt;destroy;
}


sub addhelp {
	my $this=shift;

	my $help=$this-&gt;question-&gt;extended_description;
	return unless length $help;

	$this-&gt;addbutton(gettext("_Help"), sub {
		$this-&gt;create_message_dialog("gtk-dialog-info",
		                              gettext("Help"),
					     to_Unicode($help));
	});

	if (defined $this-&gt;tip ){
		$this-&gt;tip-&gt;set_tooltip_text(to_Unicode($help));
	}
}


sub value {
	my $this=shift;

	return '';
}


1
</pre></body></html>