On Sun, 3 Jul 2022 14:30:27 +0200, Mike Wey wrote:

I believe it should work if you replace 'r' with GdkKeysyms.GDK_F6.

This constructor doesn't allow changing the keys during runtime, for
that you will want to use MenuItem.setAccelPath and the related functions.

I should have mentioned that I have already tried that. It did not work. Maybe because accelKey is char while Gdk.Keysyms.GDK_F6 is an enum? I will give it another try.