[racket-users] Want to change Racket GUI application title (on the taskbar)

2020-11-22 Thread JavaCommons


When I build Racket (scheme) GUI application like this:

raco exe --gui gui-01.rkt

Windows taksbar displays the name of the application as "Racket GUI 
application". I want to change this name to something like "My GUI 
Program". Is this possible?

[image: 無題.png]

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/8a775b49-8bb3-4ffb-95b4-09d43ffcc637n%40googlegroups.com.


[racket-users] Questions

2020-11-22 Thread Nate Griswold
Hello. I have a few questions:

1) Why do the docs say that racket_eval and racket_apply eval and apply in
the “initial” or “original” racket thread? I have verified that the thread
id returned from pthread_self when using racket_apply in c code called from
a racket place is different from the thread id of the thread i called
racket_boot on.

2) I noticed that if i racket_eval in c code called by a racket place, i
can’t evaluate things that would otherwise (in racket code) be available in
the place’s namespace. What is the correct way to get at things in the
place’s racket namespace from c code? Is my problem unique to using a
place, or would i have this problem in a non-place scenario as well?

3) (related to 2) I want to be able to put and get from a place channel
from a long-running c function. If i just pass a place channel to the
function, that is wrong because if i am correct in my thinking (and in what
i have witnessed) there is a chance that when i go to use that channel in
the future, it will have been moved by the garbage collector. Is there any
way to prevent a specific value from being garbage collected, at least for
the lifetime of my place? This is related to (2) because i actually don’t
need this functionality if i can just racket_eval to get at the place
channel from the namespace of the place’s module in the middle of a
Sactivate_thread / Sdeactivate_thread session.

3) Is there any way to pass a c callback function into racket so that
racket can call that function? I defined a ctype for the function, but i
couldn’t think of a way to cast a pointer value passed into racket from c
to an instance of my ctype (the `cast` function takes existing ctypes and
not numeric values). Is there any way to manually make a value for my
function ctype using an existing pointer value?


Regarding 2 and 3, i was able to solve the underlying problem behind those
questions by creating a module to stash the channel in and passing its
module path into c code, then importing it. I wonder if anyone has a better
solution? Previously, i was using the `place` function for brevity.

Here is what i did:

(module myplace racket/base
 (provide place-main)
 (require syntax/location)

 (module stash racket/base
   (provide client-channel)
   (define client-channel (make-parameter #f)))

 (require 'stash)

 (define (place-main ch)
   (client-channel ch)
   (red_client_run_from_racket ch (quote-module-path stash))
   (error "Should not get here")))

(define p (dynamic-place (quote-module-path myplace) 'place-main))

and in c code:

int red_client_run_from_racket(ptr ch, ptr path) {
   ...
 racket_namespace_require(path);
   ...
}

Thank you

Nate

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAM-xLPpU7sQ7PoArCf27W4BVZzM-%2BUu2v4Abp2%3DubuPiFi%3D%2Bvg%40mail.gmail.com.


[racket-users] Re: Copy keybinding in DrRacket not working

2020-11-22 Thread Dimaugh Silvestris
Ok, so I have tried adding a custom keybinding so that Control+n does the 
copying:
(keybinding "c:n"
(lambda (editor evt) (send editor copy)))

Works perfect, but conflicts a bit with my muscle memory. 
So I tried adding a custom keybinding using c:c, and now when I open 
DrRacket, I get the error:
<>

But after clicking the OK button I can use DrRacket, and Control+c works as 
it should.
The error message bothers me a bit, but other than that it's now solved.

On Sunday, 22 November 2020 at 16:49:38 UTC+1 Dimaugh Silvestris wrote:

>
> For some reason, Control+c isn't working in DrRacket, while Control+x for 
> cut and Control+v work as expected. I think I've had this since I installed 
> DrRacket, and I haven't changed anything about keybindings that I remember; 
> I've been using the right-click menu instead, but it's cumbersome and after 
> a while I've gotten sick of it. 
>
> In Edit->Keybindings->Show Active Keybindings it appears as "Copy (c:c)", 
> so I have no idea what could be causing this.
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/c991c729-3100-4d70-bd8a-6b5c7d9a9737n%40googlegroups.com.


[racket-users] Copy keybinding in DrRacket not working

2020-11-22 Thread Dimaugh Silvestris

For some reason, Control+c isn't working in DrRacket, while Control+x for 
cut and Control+v work as expected. I think I've had this since I installed 
DrRacket, and I haven't changed anything about keybindings that I remember; 
I've been using the right-click menu instead, but it's cumbersome and after 
a while I've gotten sick of it. 

In Edit->Keybindings->Show Active Keybindings it appears as "Copy (c:c)", 
so I have no idea what could be causing this.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/0766489a-f8a2-4e04-b707-dc31e39dce12n%40googlegroups.com.