#!/usr/bin/perl -w
# This file was preprocessed, do not edit!
package Debconf::Element::Gnome;
use strict;
use Gtk;
use Debconf::Gettext;
use base qw(Debconf::Element);
sub init {
	my $this=shift;
	$this->hbox(Gtk::HBox->new(0, 10));
	$this->line1(Gtk::HBox->new(0, 10));
	$this->line1->show;
	$this->line2(Gtk::HBox->new(0, 10));
	$this->line2->show;
	$this->vbox(Gtk::VBox->new(0, 5));
	$this->vbox->pack_start($this->line1, 0, 0, 0);
	$this->vbox->pack_start($this->line2, 1, 1, 0);
	$this->vbox->show;
	$this->hbox->pack_start($this->vbox, 1, 1, 0);
	$this->hbox->show;
	
	$this->fill(0);
	$this->expand(0);
	$this->multiline(0);
}
sub addwidget {
	my $this=shift;
	my $widget=shift;
	if ($this->multiline == 0) {
	    $this->line1->pack_start($widget, 1, 1, 0);
	}
	else {
	    $this->line2->pack_start($widget, 1, 1, 0);
	}
}
sub adddescription {
	my $this=shift;
	my $label=Gtk::Label->new($this->question->description);
	$label->show;
	$this->line1->pack_start($label, 0, 0, 0);
}
sub addbutton {
	my $this=shift;
	my $text = shift;
	my $callback = shift;
	my $button = Gtk::Button->new_with_label($text);
	$button->show;
	$button->signal_connect("clicked", $callback);
	my $vbox = Gtk::VBox->new(0, 0);
	$vbox->show;
	$vbox->pack_start($button, 1, 0, 0);
	$this->line1->pack_end($vbox, 0, 0, 0);
}
sub addhelp {
	my $this=shift;
	
	my $help=$this->question->extended_description;
	return unless length $help;
	$this->addbutton(gettext("Help"), sub {
		my $dialog = Gnome::Dialog->new(gettext("Help"), "Button_Ok");
		my $label = Gtk::Label->new($help);
		$label->set_line_wrap(1);
		$label->show;
		$dialog->vbox->add($label);
		$dialog->run;
		$dialog->close;
	});
}
sub value {
	my $this=shift;
	return '';
}
1
