soegaard2
2021-4-18 08:14:16

The snapshots can be downloaded here: https://www.cs.utah.edu/plt/snapshots/ What’s the meaning of the “as current” links at the right?


popa.bogdanp
2021-4-18 09:13:33

I think they are intended as a way to let tools download the latest snapshot without knowing what the version number is up-front. That’s how I use them in setup-racket, <https://github.com/Bogdanp/setup-racket/blob/424adc8280bb324a1ff0d042f5b32d636fa75321/src/common.ts#L54-L62|for example>.


sschwarzer
2021-4-18 11:00:10

> One alternative would be to simply shadow the vector bindings, … I thought about that, too, but you’re in trouble if you want to also use a genuine vector in the same code unit where you apply the shadowing. In other words, shadowing would also change the meaning of vectors you still want to be vectors.

That said, I can see myself using shadowing where it doesn’t change too much (see above), but only temporarily, maybe during a refactoring.


soegaard2
2021-4-18 11:29:50

soegaard2
2021-4-18 11:30:37

@alexharsanyi I see a difference. It’s difficult (impossible?) to reactivate the tooltips.


alexharsanyi
2021-4-18 12:20:27

One of the changes I made was that the tooltip is dismissed if the mouse is moved, and will not re-appear again unless the mouse leaves the control and enters again


alexharsanyi
2021-4-18 12:20:34

with another 500ms wait


alexharsanyi
2021-4-18 12:20:43

this works nicely on windows 10, and does not make the tooltips too anoying (which they were before, as one could not get rid of them)


alexharsanyi
2021-4-18 12:23:54

Here is how this works


soegaard2
2021-4-18 12:56:21

I added some displays to on-subwindow-event . I only see motion events, no enter/leave events at all. Is that expected?


mflatt
2021-4-18 13:22:46

Yes, enter/leave events vary across widgets and platforms. Sometimes they’re providing by the underlying toolkit, sometimes they have to be synthesized, and sometimes they behave slightly differently.


mflatt
2021-4-18 13:24:23

@robby looked into this a lot when trying to make tabs in DrRacket work right, so he may have some recommendations. But he was working with canvases, where there’s more effort (maybe still not enough) at the racket/gui level to provide enter/leave events.


robby
2021-4-18 14:04:06

I don’t have any general principles (beyond the advice to get a few VMs set up, sadly ….) sorry.


robby
2021-4-18 14:07:19

I do have one piece of advice: your event handlers need to be aware of the mouse down state. If you have seen a down event things will behave differently than if you haven’t. In particular you will see events outside when you got a down event. (Maybe this is obvious but various controls I had made messed it up.)


josh803
2021-4-18 15:51:13

Hi! Does anybody know if it’s possible to load arbitrary TrueType fonts into Dr. Racket for use in the drawing context? I want to provide my font (xxx.ttf) as a resource so the user doesn’t have to install it themselves. Aside from the “sfont” experiment (that seems to want UFO fonts (not .ttf)) I can’t find any way to do that. Thanks!


josh803
2021-4-18 16:04:10

(BTW, “xxx.ttf” is just an example of the possible font name, not an actual X-rated font… Just wanted to clear that up.)


soegaard2
2021-4-18 16:42:52

Cross platform guis are tricky…

I wonder whether the lack of leave events on mac is the cause of the “tooltips only show once”-problem. In on-subwindow-event the clause ((not mouse-inside-widget?) (set! popup-x #f) (set! popup-y #f) (show-tooltip receiver event #t)) is never triggered. And I think the intention was to simulate a leave event. Since a motion event is only sent to the sub-window if the mouse is inside, it makes sense that clause is never triggered.


spdegabrielle
2021-4-18 20:09:55

Sorry I don’t know much about this but my understanding is the gui toolkit used by Racket (and DrRacket) uses fonts from the os - if you install the font via the os font installation you can select it in DrRacket

The rendering engine (pango?) used by racket (whose name I forget) does the work. Last time I tried a custom font it seemed to work in DrRacket. (I can’t remember if it was ttf)


josh803
2021-4-18 21:19:49

Hi! Thanks for taking a look! However I don’t want the user to have to install the font. Was hoping to just use it for my specific game, otherwise user might need admin permissions.