summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2004-07-27 06:43:54 +0000
committerAntoine Ginies <aginies@mandriva.com>2004-07-27 06:43:54 +0000
commit48ce0b41855d27d193f8cf7a47aa4d6f480f5b31 (patch)
treee724c9cbfe28190ef0dc5bc303fd7cf862db6334
parent5da2a3fe01c6c3bcb9812d1318fcba727b91d926 (diff)
downloaddrakpxelinux-48ce0b41855d27d193f8cf7a47aa4d6f480f5b31.tar
drakpxelinux-48ce0b41855d27d193f8cf7a47aa4d6f480f5b31.tar.gz
drakpxelinux-48ce0b41855d27d193f8cf7a47aa4d6f480f5b31.tar.bz2
drakpxelinux-48ce0b41855d27d193f8cf7a47aa4d6f480f5b31.tar.xz
drakpxelinux-48ce0b41855d27d193f8cf7a47aa4d6f480f5b31.zip
use SizeGroup to adjust edit box (thx pixel advice)
-rw-r--r--drakpxelinux.pl105
1 files changed, 38 insertions, 67 deletions
diff --git a/drakpxelinux.pl b/drakpxelinux.pl
index 8bdd24d..839def6 100644
--- a/drakpxelinux.pl
+++ b/drakpxelinux.pl
@@ -290,7 +290,8 @@ sub edit_box_item {
my $i = ($path->get_indices)[0];
my $dialog = new Gtk2::Dialog();
- $dialog->set_modal(0);
+ $dialog->set_modal(1);
+ $dialog->set_resizable(FALSE);
my $label = Gtk2::Entry->new;
$label->set_text($listpxe[$i]{label});
@@ -361,79 +362,49 @@ sub edit_box_item {
my $option = Gtk2::Entry->new;
$option->set_text($listpxe[$i]{option});
+ my %size_groups = map { $_ => Gtk2::SizeGroup->new('horizontal') } qw(label widget button);
+ my $label_and_widgets = sub {
+ my ($label, $widget, $button) = @_;
+ gtkpack_(Gtk2::HBox->new(0,5),
+ 0, gtkadd_widget($size_groups{label}, $label),
+ 1, gtkadd_widget($size_groups{widget}, $widget),
+ 2, gtkadd_widget($size_groups{button}, $button),
+ );
+ };
+
gtkpack_($dialog->vbox,
- 0, gtkadd(Gtk2::Frame->new(("Description")),
- gtkpack(gtkset_border_width(Gtk2::VBox->new, 2),
- gtkadd(Gtk2::HBox->new,
- Gtk2::Label->new("Label"),
- $label,
- ),
- gtkadd(Gtk2::HBox->new,
- Gtk2::Label->new("Info"),
- $info,
- ),
- ),
- ),
- 0, gtkadd(Gtk2::Frame->new(("Boot image")),
- gtkadd(gtkset_border_width(Gtk2::VBox->new, 2),
- gtkadd(Gtk2::HBox->new,
- Gtk2::Label->new("Kernel"),
- $kernel,
- $buttonkernel,
- ),
- gtkadd(Gtk2::HBox->new,
- Gtk2::Label->new("Initrd"),
- $initrd,
- $buttoninitrd,
- ),
- ),
+ 0, gtkadd(Gtk2::Frame->new(("Descrition")),
+ gtkpack_(Gtk2::VBox->new,
+ 0, $label_and_widgets->(N("Label"), $label, ""),
+ 0, $label_and_widgets->(N("Info"), $info, ""),
+ ),
+ ),
+ 0, gtkadd(Gtk2::Frame->new(("Boot image")),
+ gtkpack_(Gtk2::VBox->new,
+ 0, $label_and_widgets->(N("Kernel"), $kernel, $buttonkernel),
+ 0, $label_and_widgets->(N("Initrd"), $initrd, $buttoninitrd),
+ ),
),
0, gtkadd(Gtk2::Frame->new(("Automatic Options")),
- gtkadd(gtkset_border_width(Gtk2::VBox->new, 2),
- gtkadd(Gtk2::HBox->new,
- Gtk2::Label->new("Automatic"),
- $automatic,
- ),
- gtkadd(Gtk2::HBox->new,
- Gtk2::Label->new("Interface"),
- $interface,
- ),
- gtkadd(Gtk2::HBox->new,
- Gtk2::Label->new("Network"),
- $network,
- ),
- gtkadd(Gtk2::HBox->new,
- Gtk2::Label->new("Server"),
- $server,
- ),
- gtkadd(Gtk2::HBox->new,
- Gtk2::Label->new("Directory"),
- $directory),
- ),
+ gtkpack_(Gtk2::VBox->new,
+ 0, $label_and_widgets->(N("Automatic"), $automatic, ""),
+ 0, $label_and_widgets->(N("Interface"), $interface, ""),
+ 0, $label_and_widgets->(N("Network"), $network, ""),
+ 0, $label_and_widgets->(N("Server"), $server, ""),
+ 0, $label_and_widgets->(N("Directory"), $directory, ""),
+ ),
),
0, gtkadd(Gtk2::Frame->new(("Display")),
- gtkadd(gtkset_border_width(Gtk2::VBox->new, 2),
- gtkadd(Gtk2::HBox->new,
- Gtk2::Label->new("Vga"),
- $vga,
- ),
- gtkadd(Gtk2::HBox->new,
- Gtk2::Label->new("Display"),
- $display,
- ),
- ),
+ gtkpack_(Gtk2::VBox->new,
+ 0, $label_and_widgets->(N("Vga"), $vga, ""),
+ 0, $label_and_widgets->(N("Display"), $display, ""),
+ ),
),
0, gtkadd(Gtk2::Frame->new(("Other options")),
- gtkadd(gtkset_border_width(Gtk2::VBox->new, 2),
- gtkadd(Gtk2::HBox->new,
- Gtk2::Label->new("Ramdisk"),
- $ramdisk,
- ),
- gtkadd(Gtk2::HBox->new,
- Gtk2::Label->new("Option"),
- $option,
- ),
- ),
+ gtkpack_(Gtk2::VBox->new,
+ 0, $label_and_widgets->(N("Ramdisk"), $ramdisk, ""),
+ 0, $label_and_widgets->(N("Option"), $option, ""),
+ ),
),
0, create_okcancel({
cancel_clicked => sub { $dialog->destroy },