Now accepts "/quit" to quit instead of "quit"

This commit is contained in:
Ibrahim Mkusa 2017-04-23 11:27:38 -04:00
parent 183fad9de3
commit 6bac96cfdb
2 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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)