summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-11-05 13:20:15 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-11-05 13:20:15 +0000
commitb8687904824bcc18f07e1140125f5218d04b08e0 (patch)
tree00c2b7ff096d32b3e4c2a7cf7595d5234c207e40
parent97cbb1bf94d822d63971d30b25042d8d47c9f246 (diff)
downloaddrakx-backup-do-not-use-b8687904824bcc18f07e1140125f5218d04b08e0.tar
drakx-backup-do-not-use-b8687904824bcc18f07e1140125f5218d04b08e0.tar.gz
drakx-backup-do-not-use-b8687904824bcc18f07e1140125f5218d04b08e0.tar.bz2
drakx-backup-do-not-use-b8687904824bcc18f07e1140125f5218d04b08e0.tar.xz
drakx-backup-do-not-use-b8687904824bcc18f07e1140125f5218d04b08e0.zip
- fix dialog boxes using a scrollbar
- cleanup
-rw-r--r--perl-install/Newt/Newt.xs50
-rw-r--r--perl-install/interactive/newt.pm7
2 files changed, 8 insertions, 49 deletions
diff --git a/perl-install/Newt/Newt.xs b/perl-install/Newt/Newt.xs
index fba7c5455..6ffdb1e63 100644
--- a/perl-install/Newt/Newt.xs
+++ b/perl-install/Newt/Newt.xs
@@ -105,41 +105,6 @@ newtWinTernary(title,button1,button2,button3,message)
char * button3;
char * message;
-void
-newtWinMenu(title,text,suggestedWidth,flexDown,flexUp,maxListHeight,list,def,buttons, ...)
- char * title;
- char * text;
- int suggestedWidth;
- int flexDown;
- int flexUp;
- int maxListHeight;
- char **list;
- int def;
- char *buttons;
- PPCODE:
- {
- int button;
-#define nb 8
-#define a(i) SvPV(ST(i + nb),PL_na)
- button = newtWinMenu(title, text, suggestedWidth, flexDown, flexUp, maxListHeight, list, &def,
- items > nb + 0 ? a( 0) : NULL,
- items > nb + 1 ? a( 1) : NULL,
- items > nb + 2 ? a( 2) : NULL,
- items > nb + 3 ? a( 3) : NULL,
- items > nb + 4 ? a( 4) : NULL,
- items > nb + 5 ? a( 5) : NULL,
- items > nb + 6 ? a( 6) : NULL,
- items > nb + 7 ? a( 7) : NULL,
- items > nb + 8 ? a( 8) : NULL,
- items > nb + 9 ? a( 9) : NULL,
- items > nb + 10 ? a(10) : NULL,
- NULL);
-#undef a
- EXTEND(SP, 2);
- PUSHs(sv_2mortal(newSViv(button)));
- PUSHs(sv_2mortal(newSViv(def)));
- }
-
MODULE = Newt PACKAGE = Newt::Component PREFIX = newt
void
@@ -378,18 +343,13 @@ newtCreateGrid(cols,rows)
int rows;
Newt::Grid
-HCloseStacked(first, ...)
- Newt::Component first;
+HCloseStacked3(c1, c2, c3)
+ Newt::Component c1;
+ Newt::Component c2;
+ Newt::Component c3;
CODE:
{
- int i;
- newtComponent *p = alloca(sizeof(newtComponent) * (2 * items + 1));
- for (i = 0; i < items; i++) {
- p[2 * i] = 1;
- p[2 * i + 1] = (newtComponent)SvIV((SV*)SvRV( ST(i) ));
- }
- p[2 * items] = NULL;
- RETVAL = ((newtGrid (*)()) newtGridHCloseStacked)();
+ RETVAL = newtGridHCloseStacked(NEWT_GRID_COMPONENT, c1, NEWT_GRID_COMPONENT, c2, NEWT_GRID_COMPONENT, c3);
}
OUTPUT:
RETVAL
diff --git a/perl-install/interactive/newt.pm b/perl-install/interactive/newt.pm
index 0f3dd7456..43b58aa62 100644
--- a/perl-install/interactive/newt.pm
+++ b/perl-install/interactive/newt.pm
@@ -175,15 +175,14 @@ sub ask_fromW_real {
#- options of a native PostScript printer in printerdrake)
#- !! works badly together with list's (lists are one widget, so a
#- big list window will not switch to scrollbar mode) :-(
- if ((((grep { $_->{type} eq 'bool' } @$l) > 6) ||
- ((@$l) > 3)) && $total_size > $height) {
+ if (@$l > 3 && $total_size > $height) {
$grid->GridPlace(1, 1); #- Uh?? otherwise the size allocated is bad
- my $scroll = Newt::Component::VerticalScrollbar(-1, -1, $height, 9, 10);
+ my $scroll = Newt::Component::VerticalScrollbar(-1, -1, $height, 9, 10); # 9=NEWT_COLORSET_CHECKBOX, 10=NEWT_COLORSET_ACTCHECKBOX
my $subf = $scroll->Form('', 0);
$subf->FormSetHeight($height);
$subf->FormAddGrid($grid, 0);
- Newt::Grid::HCloseStacked($subf, separator(1, $height), $scroll);
+ Newt::Grid::HCloseStacked3($subf, separator(1, $height-1), $scroll);
} else {
$grid;
}