diff options
-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) |