gtk: fix over-eager attempt at alt- menu activation
Closes PR 11843 original commit: aabd5f7bd2e0b71ad218f9f0475abcd64e4b9afa
This commit is contained in:
parent
2db01ab5e4
commit
cc9dc765c3
|
@ -145,4 +145,16 @@
|
|||
(g_object_ref gtk)
|
||||
(gtk_menu_item_set_submenu item gtk))
|
||||
(gtk_menu_shell_append gtk item)
|
||||
(gtk_widget_show item)))))
|
||||
(gtk_widget_show item))))
|
||||
|
||||
(define/public (activate-item menu)
|
||||
;; Gtk takes care of menu activation as appropriate;
|
||||
;; return #f to indcate that the key wasn't handled
|
||||
#f
|
||||
#;
|
||||
(let loop ([menus menus])
|
||||
(cond
|
||||
[(null? menus) (void)]
|
||||
[(eq? menu (cadar menus))
|
||||
(gtk_menu_shell_select_item gtk (caar menus))]
|
||||
[else (loop (cdr menus))]))))
|
||||
|
|
|
@ -237,7 +237,9 @@
|
|||
(gtk_menu_shell_append gtk item-gtk)
|
||||
(gtk_widget_show item-gtk))))
|
||||
|
||||
(def/public-unimplemented select)
|
||||
(define/public (select bm)
|
||||
(send parent activate-item this))
|
||||
|
||||
(def/public-unimplemented get-font)
|
||||
(def/public-unimplemented set-width)
|
||||
(def/public-unimplemented set-title)
|
||||
|
|
|
@ -53,7 +53,8 @@
|
|||
(when parent
|
||||
(let ([m (regexp-match #rx"&[^&]" label)])
|
||||
(when m
|
||||
(send parent popup-menu-with-char (string-ref (car m) 1))))))
|
||||
(send parent popup-menu-with-char (string-ref (car m) 1)))))
|
||||
#t)
|
||||
|
||||
(def/public-unimplemented get-font)
|
||||
(def/public-unimplemented set-width)
|
||||
|
|
|
@ -68,9 +68,7 @@
|
|||
[label (mcar data)]
|
||||
[menu (mcdr data)])
|
||||
(if (regexp-match re label)
|
||||
(begin
|
||||
(send menu select this)
|
||||
#t)
|
||||
(send menu select this)
|
||||
#f)))
|
||||
items)))))))))]
|
||||
[on-demand (lambda () (as-exit (lambda () (send mred on-demand))))]
|
||||
|
|
Loading…
Reference in New Issue
Block a user