Re: [racket-users] GUI (get-directory)

2019-12-05 Thread Jens Axel Søgaard
FWIW I just found an introduction to Racket GUIs by Andres Ramos:

https://www.youtube.com/watch?v=yo6wVXS6dkU

/soegaard

Den tir. 19. nov. 2019 kl. 18.49 skrev pow bam :

> Hello, I am very new to programming and up until this point I had only
> seriously messed with the AutoIt language - it was easy to search and find
> out how to do things as their forums were quite active and already
> possessed a wealth of data that any determined person could get by on with
> just search alone and never needing to actively post. I built myself an
> entire program in this fashion, learning as I went. I decided I wanted to
> learn how to do this in a "real" full-blown language (tho you could easily
> argue that AutoIt is a full language now). I've decided that I love the
> idea of Lisp and Racket in particular but I am hitting roadblocks to that
> goal as the search functionality and community just isn't near the level of
> AutoIt. So here I am, actually posting in the only place it appears I can..
>
> I am trying to make use of (get-directory) which pops up a GUI prompt
> asking a user to select a directory..
>
> https://docs.racket-lang.org/gui/Windowing_Functions.html#%28def._%28%28lib._mred%2Fmain..rkt%29._get-directory%29%29
>
> Here is my code which works..
>
> #lang racket/gui
> (require racket/class)
> (define gds-main
>   (new frame%
>[label "GD Switcher"]
>[width 250]
>[height 300]
>[style '(no-resize-border)]))
> (define panel-1
>   (new vertical-panel%
>[parent gds-main]
>[style '(border)]
>[alignment '(center center)]))
> (new choice%
>  [parent panel-1]
>  [label #f]
>  [choices '("Forgotten Gods"
> "Ashes of Malmouth"
> "Vanilla Ice Cream")])
> (get-directory)
> (send gds-main center 'both)
> (send gds-main show #t)
>
>
> ..if I just use get directory as-is but if I try
>
> (get-directory [message "Select a folder.."])
>
> in any combination, and I've tried so many, it only ever gives me back the
> error..
>
> message: unbound identifier in: message
>
> What am I missing, how do I make this work?
>
> Thank you in advance for any insight.
>
> --
> 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/67dff8ff-cbd2-4d26-8901-34fc2be43928%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/CABefVgzEfWzbbrosdotifEhVHn3eQ%3DAbCeTY%2BZUGdRLEodT8DA%40mail.gmail.com.


Re: [racket-users] GUI (get-directory)

2019-12-03 Thread James Platt
On Nov 21, 2019, at 6:27 PM, Alexis King wrote:

>> On Nov 21, 2019, at 11:21, James Platt  wrote:
>> 
>> If we can direct more of the energy of this community into, not just 
>> improving the documentation, but the way we do documentation, it would be a 
>> major improvement.  Requiring lots of parentheses doesn't bother me.  Lack 
>> of infix notation doesn't bother me.  Lack of documentation does.
> 
> Every so often I see this sentiment expressed, and I’ll be entirely honest: I 
> find it very surprising! I don’t at all want to suggest your experiences are 
> untrue, or that they’re somehow your fault or not worth fixing, but they’re 
> so contrary to my own that I must be missing something. I would go so far as 
> to say that my experience with Racket’s documentation is far and away the 
> best of every programming language I have ever used, even without adjusting 
> for its comparatively small community.

It is definitely true that poor documentation is a general problem with 
programming languages and the Racket Guide and Racket Reference are, indeed, 
among the best that I have seen.  I really like the fact that the Racket 
community explicitly recognizes the need to have both a guide and a reference. 
Documentation actually is a big problem almost everywhere these days.  

> 
> I will concede that racket/draw and racket/gui are particularly sparse in the 
> way of inline examples—perhaps something about the amount of context setup 
> often necessary—but as the main distribution goes, that feels more like an 
> exception than the norm! If you pick any section in the Datatypes chapter of 
> the Racket Reference, for example, virtually every binding has typeset 
> examples (using the scribble/example library you mention). Sections with 
> fewer inline examples usually at least have links to example-heavy companion 
> sections in the Guide. Even a library like pict, which is visual in the same 
> way racket/draw and racket/gui are, has typeset examples for nearly every 
> documented export.

A lot of what I have been working on in Racket is GUI related.  That might be 
part of the reason my experience has been so different than yours.  I have 
almost entirely been using the Racket Guide rather than the Racket Reference.  
I suppose I should start collecting examples of lack of examples.  As it 
happens, my next project is about creating stand-alone executables.  Look at 
the Racket Guide about raco distribute and there are no examples at all.  I'm 
looking here:  https://docs.racket-lang.org/raco/exe.html?q=raco%20distribute

I also have not been able to find Racket examples very easily with a web 
search.  I did some example searches just now to make sure I'm right about that 
and it looks like my default search engine, DuckDuckGo, has a particular 
problem with Racket.  DuckDuckGo, usually gets just as good, and sometimes 
better, results than Google, in my general experience.  However, I got better 
results with Startpage for a few Racket related searches.  For example, I 
recently needed to use a PBKDF in my Racket code.  Search for "racket pbkdf" 
(without the quotes) in DuckDuckGo and you don't get much of use but Google or 
Startpage get you straight to the most relevant material.  So I'll have to make 
sure to try Startpage for my Racket work from now on.  Maybe this part is not 
so bad as I thought.  

Something else which I am not able to find easily about creating standalone 
executables is an overall description of how to do this.  If I understand 
correctly, there are at least three methods.  There are command line tools, 
there is the "Create Executable" command in DrRacket or you can create and run 
a makefile.   Are there limitations to any of these compared to the others?  

The documentation probably belongs here:
https://docs.racket-lang.org/guide/exe.html

I do expect that this blog post will be helpful:
https://www.greghendershott.com/2017/04/racket-makefiles.html

I'm sure that I  can also find lots of examples of makefiles around which I can 
look through but it is nicer to have some official documentation.  I probably 
will create some documentation about this myself but I would want to run it by 
someone with more knowledge on the topic before contributing it to the official 
documentation.  It's easier to create a blog post and give the information on a 
this-worked-for-me basis.  What I would go ahead and add to the official 
documentation is a link to the DrRacket Create Executable documentation, which 
is missing at first link above.  


> I agree that it would be nice to make contributing small documentation 
> improvements more accessible, but your wording seems to suggest you feel 
> there is a deeper, systemic problem with the existing documentation. Could 
> you say more on what that is? Or, maybe better yet, could you point to some 
> other language’s documentation that you feel does things better that we might 
> take inspiration from? I, at least, would find that e

Re: [racket-users] GUI (get-directory)

2019-11-21 Thread Alexis King
> On Nov 21, 2019, at 11:21, James Platt  wrote:
> 
> If we can direct more of the energy of this community into, not just 
> improving the documentation, but the way we do documentation, it would be a 
> major improvement.  Requiring lots of parentheses doesn't bother me.  Lack of 
> infix notation doesn't bother me.  Lack of documentation does.

Every so often I see this sentiment expressed, and I’ll be entirely honest: I 
find it very surprising! I don’t at all want to suggest your experiences are 
untrue, or that they’re somehow your fault or not worth fixing, but they’re so 
contrary to my own that I must be missing something. I would go so far as to 
say that my experience with Racket’s documentation is far and away the best of 
every programming language I have ever used, even without adjusting for its 
comparatively small community.

I will concede that racket/draw and racket/gui are particularly sparse in the 
way of inline examples—perhaps something about the amount of context setup 
often necessary—but as the main distribution goes, that feels more like an 
exception than the norm! If you pick any section in the Datatypes chapter of 
the Racket Reference, for example, virtually every binding has typeset examples 
(using the scribble/example library you mention). Sections with fewer inline 
examples usually at least have links to example-heavy companion sections in the 
Guide. Even a library like pict, which is visual in the same way racket/draw 
and racket/gui are, has typeset examples for nearly every documented export.

I agree that it would be nice to make contributing small documentation 
improvements more accessible, but your wording seems to suggest you feel there 
is a deeper, systemic problem with the existing documentation. Could you say 
more on what that is? Or, maybe better yet, could you point to some other 
language’s documentation that you feel does things better that we might take 
inspiration from? I, at least, would find that extremely helpful to understand 
what steps Racket could take to do 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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/12BB5A99-B6AD-4474-AFC8-4AA66D47E52E%40gmail.com.


Re: [racket-users] GUI (get-directory)

2019-11-19 Thread Hadi Moshayedi
On Tue, Nov 19, 2019 at 9:49 AM pow bam  wrote:


> (get-directory [message "Select a folder.."])
>
>
You should just use (get-directory "Select a folder.."). The docs

says the syntax is

(get-directory

 [ message
parent
directory
style
#:dialog-mixin dialog-mixin])   →   (or/c

 path #f)

Here the "[...]" means that message, parent, etc. are all optional and not
named args. The #:dialog-mixin syntax means that it is a named arg.

-- Hadi

-- 
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/CAK%3D1%3DWpTEEVBQJOZnRq%3DWiJTkPty1_7FqDpvqF7xKbFerejB6Q%40mail.gmail.com.


[racket-users] GUI (get-directory)

2019-11-19 Thread pow bam
Hello, I am very new to programming and up until this point I had only 
seriously messed with the AutoIt language - it was easy to search and find 
out how to do things as their forums were quite active and already 
possessed a wealth of data that any determined person could get by on with 
just search alone and never needing to actively post. I built myself an 
entire program in this fashion, learning as I went. I decided I wanted to 
learn how to do this in a "real" full-blown language (tho you could easily 
argue that AutoIt is a full language now). I've decided that I love the 
idea of Lisp and Racket in particular but I am hitting roadblocks to that 
goal as the search functionality and community just isn't near the level of 
AutoIt. So here I am, actually posting in the only place it appears I can..

I am trying to make use of (get-directory) which pops up a GUI prompt 
asking a user to select a directory..
https://docs.racket-lang.org/gui/Windowing_Functions.html#%28def._%28%28lib._mred%2Fmain..rkt%29._get-directory%29%29

Here is my code which works..

#lang racket/gui
(require racket/class)
(define gds-main
  (new frame%
   [label "GD Switcher"]
   [width 250]
   [height 300]
   [style '(no-resize-border)]))
(define panel-1
  (new vertical-panel%
   [parent gds-main]
   [style '(border)]
   [alignment '(center center)]))
(new choice%
 [parent panel-1]
 [label #f]
 [choices '("Forgotten Gods"
"Ashes of Malmouth"
"Vanilla Ice Cream")])
(get-directory)
(send gds-main center 'both)
(send gds-main show #t)


..if I just use get directory as-is but if I try

(get-directory [message "Select a folder.."])

in any combination, and I've tried so many, it only ever gives me back the 
error..

message: unbound identifier in: message

What am I missing, how do I make this work?

Thank you in advance for any insight.

-- 
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/67dff8ff-cbd2-4d26-8901-34fc2be43928%40googlegroups.com.