Using get-file in racket/gui ...

56 views
Skip to first unread message

Don Green

unread,
Jun 10, 2021, 9:09:20 AM6/10/21
to Racket Users
I want the file manipulation popup in racket/gui to display a specified dir, not the current directory.
Is that possible?
(get-file #f f) ;displays the popup showing the current directory in frame f.

I expected the following to display the popup showing the specified directory but it does not:
(get-file (string->path "/home/don/projects") f)

Any suggestions?
Don

Crystal Jacobs

unread,
Jun 10, 2021, 9:52:38 AM6/10/21
to Don Green, Racket Users
Looking at the docs:

https://docs.racket-lang.org/gui/Windowing_Functions.html?q=get-file#%28def._%28%28lib._mred%2Fmain..rkt%29._get-file%29%29

It seems like the second argument is the message shown in the title of the
pop-up window. You can include a path as the fourth argument:

(get-file #f f "/home/don/projects")

-Crystal
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/c1fdeeb1-e2c1-4ff1-8353-2d6e61399a61n%40googlegroups.com.
>
>

Crystal Jacobs

unread,
Jun 10, 2021, 9:53:53 AM6/10/21
to Don Green, Racket Users
Of course, I meant the third, not fourth. Oops!

Don Green

unread,
Jun 10, 2021, 12:03:06 PM6/10/21
to Racket Users
Where is the documentation that describes how to interpret the racket syntax?
For example:
(get-file  (message parent directory ...)) ;where the arg list of options are optional but if included are positional meaning that to specify an argument such as 'directory' means that the previous 2 args must also be specified.

Sorawee Porncharoenwase

unread,
Jun 10, 2021, 12:12:50 PM6/10/21
to Don Green, Racket Users
The Racket Reference has a section on the notation used in documentations: https://docs.racket-lang.org/reference/notation.html

But yes, what you said is correct: you are forced to specify every prior optional positional argument. This is why I think optional positional arguments are bad in general. Optional keyword arguments are much better.

--
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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages