Re: [racket-users] DrRacket Font Selection

2018-01-17 Thread hashim muqtadir
I have the same problem on Fedora 27, Racket 6.11. I don't recall the last 
time I tried changing fonts so I'm not sure when it happened. I do 
distinctly remember font selection used to work once upon a time. And the 
same workaround works for me, too. As in, if I just use the scroll wheel on 
that menu and press Enter, and open it up again, more fonts show up. And I 
tried that code snippet; for me, too, only "a" appears, not "b" and "c".

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] DrRacket Font Selection

2017-06-29 Thread Lehi Toskin
Now that I have figured out how to get `force-cache` to run through alternate 
means (using the scroll wheel) and have my preferred font selected, I think 
I'll be okay until a fix has been added. I think this started to happen when I 
upgraded to v6.9 and then downgraded to v6.8. I couldn't say *why*, but IIRC 
that also around the time when I started to have font issues.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] DrRacket Font Selection

2017-06-27 Thread Robby Findler
So I guess this is a bug somewhere in how event handling is happening.
If you wanted to work around it temporarily so you can set the font
how you want to, you could change this `unless` expression to be just
its body, ie `(force-cache receiver)`.

https://github.com/racket/drracket/blob/master/drracket/drracket/private/font.rkt#L88-L91

At least, I think that will work. Alternatively, you could add:

```
(thread (lambda () (sleep .1) (queue-callback (force-cache font-name-control
```

just after this line:

https://github.com/racket/drracket/blob/master/drracket/drracket/private/font.rkt#L96

and hopefully that'll work.

Robby


On Mon, Jun 26, 2017 at 6:55 PM, Lehi Toskin  wrote:
> Yes, that is correct.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] DrRacket Font Selection

2017-06-26 Thread Lehi Toskin
Yes, that is correct.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] DrRacket Font Selection

2017-06-26 Thread Robby Findler
It sounds like, based on what you're saying, that when you run the
code below and click on the choice that appears, that you see only "a"
appear, not "a" "b" and "c". Is that right?

#lang racket/gui

(define mono-list 'uninit)

(define vp%
  (class vertical-panel%
(define/private (force-cache receiver)
  (when (eq? receiver font-name-control)
(when (symbol? mono-list)
  (set! mono-list '("a" "b" "c"))
  (send font-name-control clear)
  (for ([x (in-list mono-list)])
(send font-name-control append x)
(define/override (on-subwindow-event receiver evt)
  (unless (or (send evt moving?)
  (send evt entering?)
  (send evt leaving?))
(force-cache receiver))
  (super on-subwindow-event receiver evt))
(define/override (on-subwindow-char receiver evt)
  (force-cache receiver)
  (super on-subwindow-char receiver evt))
(super-new)))

(define f (new frame% [label ""]))
(define vp (new vp% [parent f]))
(define font-name-control (new choice% [parent vp] [label #f] [choices '("a")]))
(send f show #t)


Robby

On Sun, Jun 25, 2017 at 10:17 PM, Lehi Toskin  wrote:
> Since there is only a single choice, on-subwindow-event (line 86) will not be 
> executed by simply clicking, I need to wheel-up or wheel-down for it to 
> update the list of fonts. Pressing Enter, however, forces on-subwindow-char 
> (line 92) to execute and populate the list of fonts. Selecting the font I 
> want and restarting DrRacket will keep my font intact, but the list of fonts 
> is once again reduced to a single option - this time my font instead of 
> Monospace. I believe it has something to do with `preferences:get` call on 
> line 99, but I'm not familiar enough with the framework library to think of a 
> reason why it would be acting improperly.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] DrRacket Font Selection

2017-06-25 Thread Lehi Toskin
Since there is only a single choice, on-subwindow-event (line 86) will not be 
executed by simply clicking, I need to wheel-up or wheel-down for it to update 
the list of fonts. Pressing Enter, however, forces on-subwindow-char (line 92) 
to execute and populate the list of fonts. Selecting the font I want and 
restarting DrRacket will keep my font intact, but the list of fonts is once 
again reduced to a single option - this time my font instead of Monospace. I 
believe it has something to do with `preferences:get` call on line 99, but I'm 
not familiar enough with the framework library to think of a reason why it 
would be acting improperly.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] DrRacket Font Selection

2017-06-25 Thread Robby Findler
Oh, looking at the code, I can see how that could happen if something
has gone wrong with the callbacks in the GUI. Take a look at
drracket/private/font, and see the function `force-cache`, roughly
lines 71-86. That function is supposed to be called, but I guess some
callbacks aren't firing for you and thus it isn't being called.

Maybe if you stick some printfs in there you'll get some useful
information that would help us debug racket/gui?

Robby


On Sun, Jun 25, 2017 at 2:32 PM, Lehi Toskin  wrote:
> Yeah, that's exactly where I'm looking. In the Font Name, I see only 
> Monospace. I click on it and there are no choices except that one.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] DrRacket Font Selection

2017-06-25 Thread Lehi Toskin
Yeah, that's exactly where I'm looking. In the Font Name, I see only Monospace. 
I click on it and there are no choices except that one.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] DrRacket Font Selection

2017-06-25 Thread Robby Findler
DrRacket's font configuration is the first pane in the preferences
dialog; you will probably find it at the bottom of the Edit menu, I
guess?

If that wasn't where you were looking when you were talking about
DrRacket's decision making earlier, can you elaborate please?

Robby


On Sun, Jun 25, 2017 at 1:37 PM, Lehi Toskin  wrote:
> Where is "Other..."? I don't see it anywhere. Also, `(get-face-list 'mono)` 
> shows a whole lot more fonts than just Monospace.
>
> On Sunday, June 25, 2017 at 3:33:22 AM UTC-7, Robby Findler wrote:
>> DrRacket uses the result of (get-face-list 'mono) in its dialog. If
>> you choose "Other..." you should be able to choose from the same set
>> that get-font-from-user uses.
>>
>> Robby
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] DrRacket Font Selection

2017-06-25 Thread Lehi Toskin
Where is "Other..."? I don't see it anywhere. Also, `(get-face-list 'mono)` 
shows a whole lot more fonts than just Monospace.

On Sunday, June 25, 2017 at 3:33:22 AM UTC-7, Robby Findler wrote:
> DrRacket uses the result of (get-face-list 'mono) in its dialog. If
> you choose "Other..." you should be able to choose from the same set
> that get-font-from-user uses.
> 
> Robby
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] DrRacket Font Selection

2017-06-25 Thread Robby Findler
DrRacket uses the result of (get-face-list 'mono) in its dialog. If
you choose "Other..." you should be able to choose from the same set
that get-font-from-user uses.

Robby


On Sun, Jun 25, 2017 at 12:34 AM, Lehi Toskin  wrote:
> At some point DrRacket decided it didn't want to use any font other than 
> Monospace. In fact, Monospace is the only font that is available in the menu. 
> `(get-font-from-user)` will correctly display all my fonts, but for whatever 
> reason DrRacket doesn't want to cooperate. I've even tried using a fresh 
> .racket directory, but the result is the same.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] DrRacket Font Selection

2017-06-24 Thread Lehi Toskin
At some point DrRacket decided it didn't want to use any font other than 
Monospace. In fact, Monospace is the only font that is available in the menu. 
`(get-font-from-user)` will correctly display all my fonts, but for whatever 
reason DrRacket doesn't want to cooperate. I've even tried using a fresh 
.racket directory, but the result is the same.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.