1
0
Fork 0

- [GUI] filtered out keys that are not valid as index when selecting gemlog in 'gemlog-window'.

This commit is contained in:
cage 2024-05-18 20:08:58 +02:00
parent c24c0930e7
commit 5a6462d85c
1 changed files with 11 additions and 10 deletions

View File

@ -194,16 +194,17 @@
(list (elt items
(- (1- (length items))
actual-index))))))
(let* ((treeview (gui:treeview (gui-goodies:tree table)))
(items (gui:items treeview))
(pressed-char (gui:event-char e))
(pressed-char-code (gui:event-char-code e)))
(if (ignore-errors (parse-integer pressed-char))
(let ((index (clamp-index items (parse-integer (gui:event-char e)))))
(gui:treeview-set-selection treeview index))
(let ((index (clamp-index items (+ 10 (- pressed-char-code
97)))))
(gui:treeview-set-selection treeview index))))))
(let* ((treeview (gui:treeview (gui-goodies:tree table)))
(items (gui:items treeview))
(pressed-char (gui:event-char e))
(pressed-char-code (gui:event-char-code e)))
(when (cl-ppcre:scan "(?i)^[a-z0-9]$" pressed-char)
(if (ignore-errors (parse-integer pressed-char))
(let ((index (clamp-index items (parse-integer (gui:event-char e)))))
(gui:treeview-set-selection treeview index))
(let ((index (clamp-index items (+ 10 (- pressed-char-code
97)))))
(gui:treeview-set-selection treeview index)))))))
:append t)
(gui:focus (gui:treeview (gui-goodies:tree table)))
(gui:transient toplevel master))))