mirror of
https://codeberg.org/cage/tinmop/
synced 2025-06-05 01:09:17 +02:00
- [GUI] added selection of gemlog by keypressing, in gemlog window.
This commit is contained in:
@@ -183,5 +183,27 @@
|
|||||||
(open-gemlog-clsr main-window table))
|
(open-gemlog-clsr main-window table))
|
||||||
(gui:bind (gui:treeview (gui-goodies:tree table))
|
(gui:bind (gui:treeview (gui-goodies:tree table))
|
||||||
#$<3>$
|
#$<3>$
|
||||||
(contextual-menu-clrs (gui:treeview (gui-goodies:tree table)))))
|
(contextual-menu-clrs (gui:treeview (gui-goodies:tree table))))
|
||||||
(gui:transient toplevel master)))
|
(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))))
|
||||||
|
Reference in New Issue
Block a user