diff options
author | Ibrahim Mkusa <ibrahimmkusa@gmail.com> | 2017-04-23 11:27:38 -0400 |
---|---|---|
committer | Ibrahim Mkusa <ibrahimmkusa@gmail.com> | 2017-04-23 11:27:38 -0400 |
commit | 6bac96cfdba6be62a206b509cc532c63b9ca7a43 (patch) | |
tree | df58138c81c3b85af194c0c247492c99144592c1 | |
parent | 183fad9de3cd73a1a8d5b0a4706ca2654ae30358 (diff) |
Now accepts "/quit" to quit instead of "quit"
-rw-r--r-- | Hermes/GUI.rkt | 7 | ||||
-rw-r--r-- | Hermes/client.rkt | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/Hermes/GUI.rkt b/Hermes/GUI.rkt index d3ff29a..25a4060 100644 --- a/Hermes/GUI.rkt +++ b/Hermes/GUI.rkt @@ -65,7 +65,7 @@ ; TODO make label setable (define input (new text-field% [parent main-frame] - [label "Username:"] + [label "user"] [callback text-field-callback] )) @@ -194,10 +194,13 @@ ;; prompt user for username ;; could randomly assign a user + ;; after calling get-text set it as new label of text-field (define (get-username) - (get-text-from-user "Username set-up" "Please enter a username" + (define returned (get-text-from-user "Username set-up" "Please enter a username" main-frame "user" (list 'disallow-invalid) #:validate string? )) + (send input set-label returned) + returned) ;;dispatch goes below that ;; TODO get username function maybe diff --git a/Hermes/client.rkt b/Hermes/client.rkt index d94fc70..6752c1e 100644 --- a/Hermes/client.rkt +++ b/Hermes/client.rkt @@ -99,7 +99,7 @@ ; TODO prompt for color as well ; TODO /quit instead of quit - (cond ((string=? input "quit") + (cond ((string=? input "/quit") (displayln (string-append date-print username " signing out. See ya!") out) (flush-output out) (close-output-port error-out) |