[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
18/26: gurses: Populate the choices box in forms.
From: |
John Darrington |
Subject: |
18/26: gurses: Populate the choices box in forms. |
Date: |
Sun, 22 Jan 2017 12:09:25 +0000 (UTC) |
jmd pushed a commit to branch wip-installer
in repository guix.
commit 3b47940b223ccc61e6e4726ed3bfa64c911560fc
Author: John Darrington <address@hidden>
Date: Thu Jan 19 08:27:13 2017 +0100
gurses: Populate the choices box in forms.
* gurses/form.scm (make-form): Populate the choices box.
---
gurses/form.scm | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/gurses/form.scm b/gurses/form.scm
index a92a00b..25ed4ff 100644
--- a/gurses/form.scm
+++ b/gurses/form.scm
@@ -128,12 +128,24 @@ label eq? to N"
(lambda (x)
(match x
((symbol label (? list? things))
- (make-field symbol label
- (apply max
+ (let ((width (apply max
(map (lambda (x)
(string-length x))
- things))
- things #f "" 0))
+ things))))
+ (make-field symbol label width things
+ (let ((p
+ (newwin (+ 2 (length
things))
+ (+ 2 width) 0 0
#:panel #t)))
+ (box p 0 0)
+ (let loop ((ll things)
+ (y 0))
+ (if (not (null? ll))
+ (begin
+ (addstr p (car ll)
+ #:y (1+ y)
#:x 1)
+ (loop (cdr ll) (1+
y)))))
+ p)
+ "" 0)))
((symbol label (? integer? size))
(make-field symbol label size #f #f "" 0))))
items)))
- 10/26: installer: Check that swap spaces have not been assigned mount points, (continued)
- 10/26: installer: Check that swap spaces have not been assigned mount points, John Darrington, 2017/01/22
- 14/26: installer: Distinguish between Wifi encryption methods., John Darrington, 2017/01/22
- 01/26: installer: Extend the 'file-system' concept to include swap spaces., John Darrington, 2017/01/22
- 21/26: installer: Do not assume the root file system is of type "ext4"., John Darrington, 2017/01/22
- 17/26: installer: Note which types of file system are supported., John Darrington, 2017/01/22
- 25/26: installer: Emphasise that writing filesystems destroys existing data., John Darrington, 2017/01/22
- 05/26: installer: Fix bug where the selected item of main page was not indicated., John Darrington, 2017/01/22
- 08/26: gurses: form: Use match instead of car, cdr etc., John Darrington, 2017/01/22
- 03/26: installer: Do not allow the creation of invalid file-system specificaitons., John Darrington, 2017/01/22
- 15/26: gurses: Allow menu update to work for panel windows., John Darrington, 2017/01/22
- 18/26: gurses: Populate the choices box in forms.,
John Darrington <=
- 06/26: installer: Add an explanatory text to the main page., John Darrington, 2017/01/22
- 22/26: installer: mount-points page: Enlarge the forms window., John Darrington, 2017/01/22
- 13/26: installer: Remove unnecessary "begin"., John Darrington, 2017/01/22
- 24/26: installer: Remove redundant list of file system types., John Darrington, 2017/01/22
- 20/26: gurses: Populate dropdown boxes in forms using a menu., John Darrington, 2017/01/22
- 12/26: installer: Fix bug in config generation., John Darrington, 2017/01/22
- 26/26: doc: Remove the text which mentions there is no graphical installer., John Darrington, 2017/01/22
- 19/26: installer: Add a popup window for forms which have multiple choice fields., John Darrington, 2017/01/22
- 16/26: gurses: Mini refactor., John Darrington, 2017/01/22
- 09/26: installer: Explicitly set the #:panel parameter for window creation procedures., John Darrington, 2017/01/22