rokitna
2021-1-9 13:29:14

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


soegaard2
2021-1-9 17:27:31

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.


soegaard2
2021-1-9 17:27:45

#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)


soegaard2
2021-1-9 17:28:53

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


ben.knoble
2021-1-9 17:39:56

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.


soegaard2
2021-1-9 17:48:35

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


massung
2021-1-9 17:50:09

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.


massung
2021-1-9 17:50:31

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


massung
2021-1-9 17:56:57

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


massung
2021-1-9 17:57:10

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


massung
2021-1-9 17:58:08

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.


spdegabrielle
2021-1-9 17:58:18

soon


soegaard2
2021-1-9 18:01:28

@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.


massung
2021-1-9 18:04:23

Yeah, that makes sense.


soegaard2
2021-1-9 18:16:09

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).


spdegabrielle
2021-1-9 20:06:18

sorawee
2021-1-10 04:40:42

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


sorawee
2021-1-10 04:41:44

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


sorawee
2021-1-10 04:44:53

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


greg
2021-1-10 04:54:54

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


greg
2021-1-10 04:55:25

greg
2021-1-10 04:56:03

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


greg
2021-1-10 04:56:54

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