mirror of
https://codeberg.org/cage/tinmop/
synced 2025-03-02 09:57:48 +01:00
- [GUI] added selection of gemlog by keypressing, in gemlog window.
This commit is contained in:
parent
3e4f5469b0
commit
6480c7673d
@ -183,5 +183,27 @@
|
||||
(open-gemlog-clsr main-window table))
|
||||
(gui:bind (gui:treeview (gui-goodies:tree table))
|
||||
#$<3>$
|
||||
(contextual-menu-clrs (gui:treeview (gui-goodies:tree table)))))
|
||||
(gui:transient toplevel master)))
|
||||
(contextual-menu-clrs (gui:treeview (gui-goodies:tree table))))
|
||||
(gui:bind (gui:treeview (gui-goodies:tree table))
|
||||
#$<KeyPress>$
|
||||
(lambda (e)
|
||||
(flet ((clamp-index (items index)
|
||||
(let ((actual-index (a:clamp index
|
||||
0
|
||||
(1- (length items)))))
|
||||
(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))))))
|
||||
:append t)
|
||||
(gui:focus (gui:treeview (gui-goodies:tree table)))
|
||||
(gui:transient toplevel master))))
|
||||
|
Loading…
x
Reference in New Issue
Block a user