Re: [racket-users] Trying to specify resize-border for instance of dialog

2021-06-25 Thread Stefan Schwarzer
On 2021-06-26 01:56, Don Green wrote:
> When I specify as follows:
> 
> (define dialog2 (new dialog%
>  (label "Get-Prototype-dialog") 
>  (style resize-border)
>  ))
> 
> Returned error:
> resize-border: unbound identifier in: resize-border

I guess you want 'resize-border (as a symbol). :-)

-- 
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/7c800f58-054c-5711-0308-b6d77e526fb3%40sschwarzer.net.


[racket-users] How do I create a scrollable popup window?

2021-06-25 Thread Don Green
How do I create a scrollable popup window?
I can create a dialog that is a popup but it is not scrollable.
The dialog class does not appear to have a scroll option.

Is this where I use a 'panel' class instead of the 'dialog' class?


-- 
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/c50eaeeb-2690-4da4-b7a0-43b97b10f970n%40googlegroups.com.


Re: [racket-users] Trying to specify resize-border for instance of dialog

2021-06-25 Thread Sorawee Porncharoenwase
It should be 'resize-border. Notice the single quote character in front of
“resize-border”.

FWIW, if you want to ask multiple short questions, you could also use the
Racket Slack channel.

The sign up link: https://racket-slack.herokuapp.com/
The channel: https://racket.slack.com/

On Fri, Jun 25, 2021 at 4:56 PM Don Green 
wrote:

> When I specify as follows:
>
> (define dialog2 (new dialog%
>  (label "Get-Prototype-dialog")
>  (style resize-border)
>  ))
>
> Returned error:
> resize-border: unbound identifier in: resize-border
>
> --
> 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/dea0122e-02ab-4d79-8432-e32b8e733fc4n%40googlegroups.com
> 
> .
>

-- 
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/CADcuegusiXL263ZQfFc%2BgfOaiMx8tDwejKQrqExJuEghcDrZ9A%40mail.gmail.com.


[racket-users] Is it possible to specify a hierarchy of menu-item options in racket/gui more than 2 deep?

2021-06-25 Thread Don Green
Is it possible to specify a hierarchy of menu-item options in racket/gui 
more than 2 deep?

In other words, I am able to define menu-item options such that I do get a 
menu-bar with options that present sub options and I can call functions 
using 'callback' from those suboptions, but I have thus far not been 
successful at creating a deeper hierarchy of subsuboptions.

-- 
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/1378d110-2b7e-44bc-b717-e2f5358c2235n%40googlegroups.com.


[racket-users] Trying to specify resize-border for instance of dialog

2021-06-25 Thread Don Green
When I specify as follows:

(define dialog2 (new dialog%
 (label "Get-Prototype-dialog") 
 (style resize-border)
 ))

Returned error:
resize-border: unbound identifier in: resize-border

-- 
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/dea0122e-02ab-4d79-8432-e32b8e733fc4n%40googlegroups.com.


[racket-users] ..

2021-06-25 Thread Don Green
..

-- 
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/b77baa3a-7ae6-44e0-a6e0-3f0aff1e9a2cn%40googlegroups.com.


Re: [racket-users] Tilde expansion requirement breaks XDG compliance

2021-06-25 Thread Matthew Flatt
Thanks! I've pushed a change based on your explanation. I was able to
confirm that it made the `XDG_CONFIG_HOME` environment take effect when
it previously did not, at least.

At Fri, 25 Jun 2021 15:44:53 -0700 (PDT), pastel raschke wrote:
> Racket seems to insist on using ~/.racket as its special place, despite the 
> apparent fix that added XDG compliance. This happens even when I have 
> racket folders neatly set up in all my xdg dirs, and clear ~/.racket* every 
> time.
> 
> Stepping through in a debugger, I found the problem was at line 2038 of 
> rktio_fs.c, where rktio_system_path calls rktio_expand_user_tilde on 
> prefer_home_str. When prefer_home_str is set from an appropriate XDG 
> environment variable, it is specifically checked to be an absolute path by 
> starting with a slash, where the default prefer_home_str starts with a 
> tilde.
> 
> This wouldn't be a problem if rktio_expand_user_tilde did not respond to an 
> absolute path by setting RKTIO_ERROR_NO_TILDE and returning null, or if the 
> error were caught in rktio_system_path and prefer_home were set properly, 
> or if prefer_home_str were not tilde expanded after being set to an 
> absolute path at line 2008 in the first place. The current behavior results 
> in the non-compliant ~/.racket being used, to my great frustration.
> 
> Thank you for your work.
> 
> -- 
> 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/e055e79d-9025-421c-ac17-4d44c5076
> e6bn%40googlegroups.com.

-- 
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/20210625173733.3d0%40sirmail.smtps.cs.utah.edu.


[racket-users] Tilde expansion requirement breaks XDG compliance

2021-06-25 Thread pastel raschke
Racket seems to insist on using ~/.racket as its special place, despite the 
apparent fix that added XDG compliance. This happens even when I have 
racket folders neatly set up in all my xdg dirs, and clear ~/.racket* every 
time.

Stepping through in a debugger, I found the problem was at line 2038 of 
rktio_fs.c, where rktio_system_path calls rktio_expand_user_tilde on 
prefer_home_str. When prefer_home_str is set from an appropriate XDG 
environment variable, it is specifically checked to be an absolute path by 
starting with a slash, where the default prefer_home_str starts with a 
tilde.

This wouldn't be a problem if rktio_expand_user_tilde did not respond to an 
absolute path by setting RKTIO_ERROR_NO_TILDE and returning null, or if the 
error were caught in rktio_system_path and prefer_home were set properly, 
or if prefer_home_str were not tilde expanded after being set to an 
absolute path at line 2008 in the first place. The current behavior results 
in the non-compliant ~/.racket being used, to my great frustration.

Thank you for your work.

-- 
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/e055e79d-9025-421c-ac17-4d44c5076e6bn%40googlegroups.com.


[racket-users] Top-level unbound identifiers during expansion

2021-06-25 Thread Greg Rosenblatt
I've encountered an identifier binding order issue that only manifests in 
the REPL.  My current workaround is to use forward definitions followed by 
set!s.  I've heard rumors that the top-level is hopeless, but I'd like to 
try and make this work without unnecessary workarounds, if possible.


To demonstrate the issue, I've defined a syntax transformer that binds 
temporary names to procedures, and defines wrapper syntax transformers for 
referencing these procedures.

This syntax works fine within a module, or other non-top-level definition 
context.  But when used at the top-level, I get an unbound identifier error 
as the first procedure body is being expanded.  The first procedure 
references the second via the wrapper.


;; issue.rkt
#lang racket/base
(provide issue-syntax)
(require (for-syntax racket/base))

(define-syntax (issue-syntax stx)
  (syntax-case stx ()
((_ ((name param ...) body ...) ...)
 (with-syntax (((name.r ...) (generate-temporaries #'(name ...
   #'(begin (define-syntax (name stx)
  (syntax-case stx ()
((_ . args) #'(name.r . args))
(_  #'name.r))) ...
(define name.r (lambda (param ...) body ...)) ...)
;; eof


> racket
Welcome to Racket v8.0 [cs].
> (require "issue.rkt")
> (let ()
(issue-syntax
  ((foo x) (bar x 1 2))  ; note the reference to bar
  ((bar a b c) `(bar: ,a ,b ,c)))
(foo 'is-the-top-level-hopeless?))
(bar: is-the-top-level-hopeless? 1 2)
> (issue-syntax
((foo x) (bar x 1 2))  ; note the reference to bar
((bar a b c) `(bar: ,a ,b ,c)))
; bar4: unbound identifier;
;  also, no #%top syntax transformer is bound
;   in: bar4
; [,bt for context]
> ,bt
; bar4: unbound identifier;
;  also, no #%top syntax transformer is bound
;   in: bar4
;   context...:
;/Applications/Racket v8.0/share/pkgs/xrepl-lib/xrepl/xrepl.rkt:1493:0
;/Applications/Racket v8.0/collects/racket/repl.rkt:11:26


I can work around this issue by altering issue-syntax to forward-define 
names before using set! to initialize them:

(define-syntax (issue-syntax stx)
  (syntax-case stx ()
((_ ((name param ...) body ...) ...)
 (with-syntax (((name.r ...) (generate-temporaries #'(name ...
   #'(begin (define-syntax (name stx)
  (syntax-case stx ()
((_ . args) #'(name.r . args))
(_  #'name.r))) ...
(define name.r #f) ...  ; forward definitions
(set! name.r (lambda (param ...) body ...)) ...)


Is there a better alternative?

-- 
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/cd8675e8-95d0-4552-badc-d4ec7a430109n%40googlegroups.com.


Re: [racket-users] Is it possible to effectively display a window with a bitmap background?

2021-06-25 Thread Jens Axel Søgaard
Use canvas%

fre. 25. jun. 2021 kl. 18.10 skrev Don Green :

> Is it possible to effectively display a window with a bitmap background?
> In racket/gui, I can see how to apply a bitmap to a button.
> If the only way to display a bitmap is in a button, is it practical to
> size the button to the entire frame or pane in the frame?
>
>
> --
> 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/565f3573-8759-4d72-8277-35bf3297befdn%40googlegroups.com
> 
> .
>
-- 
-- 
Jens Axel Søgaard

-- 
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/CABefVgzJJGXEwoFaqFiUkRDpXEqakAYUd4qNwDce2KoAJVvpyQ%40mail.gmail.com.


[racket-users] Is it possible to effectively display a window with a bitmap background?

2021-06-25 Thread Don Green
Is it possible to effectively display a window with a bitmap background?
In racket/gui, I can see how to apply a bitmap to a button.
If the only way to display a bitmap is in a button, is it practical to size 
the button to the entire frame or pane in the frame?


-- 
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/565f3573-8759-4d72-8277-35bf3297befdn%40googlegroups.com.


Re: [racket-users] Can I break my racket/gui program be broken down into multiple modules?

2021-06-25 Thread Laurent
I'm not entirely sure what you mean but, just in case, you can indeed
export created GUI widgets:
file gui1.rkt :
```
#lang racket/gui

(provide fr msg)

(define fr (new frame% [label "Hear me out"]))
(define msg (new message% [parent fr] [label "I have an important
message"]))

```
file gui2.rkt :
```
#lang racket/gui
(require "gui1.rkt")

(send fr show #t)
```


On Thu, Jun 24, 2021 at 10:41 PM Don Green 
wrote:

> Can I break my racket/gui program be broken down into multiple modules?
> I am able to require modules through the callback function but not the GUI
> definitions themselves.
>
> --
> 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/ee435195-1c19-41ad-9f47-d37f30c63fdbn%40googlegroups.com
> 
> .
>

-- 
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/CABNTSaH%2BM4pts-96fD-fhGVgqZj2Xu2QVDyw1-h_9XucA1xmwg%40mail.gmail.com.