
I love this design. I look forward to seeing where this goes. :)

While reading the documentation for button%
I came across the section, that explains how keyboard mnemonics are handled. Basically a label like “A &button” should make alt+b
a shortcut for clicking the button. The text explains that the b is underlined on Windows and Linux, but not on macOS. But … it is unclear to me if the shortcut is still supposed to work on macOS regardless.

#lang racket
(require racket/gui racket/format)
(define i 0)
(define (on-button b e)
(set! i (+ i 1))
(send t set-value (~a i)))
(define f (new frame% [label "A frame"]))
(define t (new text-field% [label "A text field"] [parent f]))
(define b (new button% [label "A &button"] [parent f] [callback on-button]))
(send f show #t)

The last sentence makes me think, that the entire paragraph might not apply to macOS.

On a mac, here; couldn’t find a key-combo that would trigger the callback. Alt+b inserts ∫, and Cmd+b just put a b (since there were no handlers for that, I assume). For macOS, the I usually see keyboard-shortcuts in a menu somewhere.

That’s what I see too. How do you interpret the text in the documentation?

So, I don’t know about Mac, but the “mnemonic” for the menu isn’t the hot key. It’s the key you press if you’re using the keyboard to navigate the menus. On Windows, this would typically be something like Alt (selects the File menu), you can press E (for &Edit menu) followed by C (for &Copy), etc.

There should be another property other than label
for the hot key.

Since this is about buttons, though (not menus), I don’t believe you can make a hot key for buttons?

You’d have to make a menu item that did the same thing.

WRT buttons, it’d be the same thing tho: when operating the interface w/ the keyboard, the mnemonic is the key you hit to quickly select the interface element.

soon

@massung So the conclusion is that hot keys work on Linux and Windows, and that macOS doesn’t support hot keys for buttons? If so, I think, the paragraph could be improved, by adding a first line saying that the following paragraph describes how to make hot keys for Windows and Linux only. I get, that macOS is mentioned in the paragraph, in order to explain that any &s are removed.

Yeah, that makes sense.

The code fur button%
only strips the & if the label is a single string. If there is an image present, the strings isn’t stripped - but that’s probably okay? (if the string is never shown, it doesn’t matter).

Thank you to everyone who joined the racket meet-up https://racket.slack.com/archives/C06V96CKX/p1610215098450700\|https://racket.slack.com/archives/C06V96CKX/p1610215098450700
Next one is 6th Feb

How is “raco setup: running: <pkgs>/racket-doc/scribblings/reference/reference.scrbl” different from “raco setup: rendering: <pkgs>/racket-doc/scribblings/reference/reference.scrbl”?

Both seems to evaluate the Scribble files. That is, the Scribble files are evaluated twice. Why does it need to do that?

I guess the “rendering” corresponds to the render pass, but shouldn’t it use existing result from earlier passes rather than evaluating from scratch?

I don’t really know, but Scribble does at least two passes.


I don’t know how those 4 passes correspond to the 2 raco steps.

I guess it’s even possible 1 of those raco steps is doing all 4 “passes”, and there’s some 5th to-do. :shrug: