[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
122/197: gurses: Populate the choices box in forms.
From: |
Danny Milosavljevic |
Subject: |
122/197: gurses: Populate the choices box in forms. |
Date: |
Mon, 3 Jul 2017 20:37:11 -0400 (EDT) |
dannym pushed a commit to branch wip-installer-2
in repository guix.
commit a208413b396177f3799493983a14985f8f9e363c
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)))
- 163/197: gurses: Cache the windows of buttons., (continued)
- 163/197: gurses: Cache the windows of buttons., Danny Milosavljevic, 2017/07/03
- 172/197: gurses: Update the cursor position when posting the form., Danny Milosavljevic, 2017/07/03
- 165/197: installer: New procedure key-value-slurp., Danny Milosavljevic, 2017/07/03
- 175/197: gurses: Don't crash if asked for an item by an invalid index., Danny Milosavljevic, 2017/07/03
- 171/197: installer: New page to edit user accounts., Danny Milosavljevic, 2017/07/03
- 187/197: installer: Add procudure for starting a wireless interface., Danny Milosavljevic, 2017/07/03
- 192/197: installer: Only build if guile-ncurses is available., Danny Milosavljevic, 2017/07/03
- 68/197: installer: Add new page to set the system role., Danny Milosavljevic, 2017/07/03
- 117/197: installer: Remove unnecessary "begin"., Danny Milosavljevic, 2017/07/03
- 113/197: installer: Explicitly set the #:panel parameter for window creation procedures., Danny Milosavljevic, 2017/07/03
- 122/197: gurses: Populate the choices box in forms.,
Danny Milosavljevic <=
- 128/197: installer: Remove redundant list of file system types., Danny Milosavljevic, 2017/07/03
- 115/197: installer: New procedure refresh*., Danny Milosavljevic, 2017/07/03
- 153/197: installer: Add optional arguments to addstr*., Danny Milosavljevic, 2017/07/03
- 97/197: installer: Whitespace changes only, Danny Milosavljevic, 2017/07/03
- 139/197: installer: Allow file system specifications to be removed., Danny Milosavljevic, 2017/07/03
- 136/197: installer: No passphrase is needed for clear networks., Danny Milosavljevic, 2017/07/03
- 138/197: installer: Clear the mount point field for swap file systems., Danny Milosavljevic, 2017/07/03
- 135/197: installer: Use a "hard" method of rebooting. Do not rely on shepherd., Danny Milosavljevic, 2017/07/03
- 148/197: installer: Support WEP encrypted wireless., Danny Milosavljevic, 2017/07/03
- 176/197: installer: Fix incorrect symbol in generated config file., Danny Milosavljevic, 2017/07/03