Now accepts "/quit" to quit instead of "quit"
This commit is contained in:
parent
183fad9de3
commit
6bac96cfdb
@ -65,7 +65,7 @@
|
|||||||
; TODO make label setable
|
; TODO make label setable
|
||||||
(define input (new text-field%
|
(define input (new text-field%
|
||||||
[parent main-frame]
|
[parent main-frame]
|
||||||
[label "Username:"]
|
[label "user"]
|
||||||
[callback text-field-callback]
|
[callback text-field-callback]
|
||||||
))
|
))
|
||||||
|
|
||||||
@ -194,10 +194,13 @@
|
|||||||
|
|
||||||
;; prompt user for username
|
;; prompt user for username
|
||||||
;; could randomly assign a user
|
;; could randomly assign a user
|
||||||
|
;; after calling get-text set it as new label of text-field
|
||||||
(define (get-username)
|
(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)
|
main-frame "user" (list 'disallow-invalid)
|
||||||
#:validate string? ))
|
#:validate string? ))
|
||||||
|
(send input set-label returned)
|
||||||
|
returned)
|
||||||
|
|
||||||
;;dispatch goes below that
|
;;dispatch goes below that
|
||||||
;; TODO get username function maybe
|
;; TODO get username function maybe
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
; TODO prompt for color as well
|
; TODO prompt for color as well
|
||||||
|
|
||||||
; TODO /quit instead of quit
|
; TODO /quit instead of quit
|
||||||
(cond ((string=? input "quit")
|
(cond ((string=? input "/quit")
|
||||||
(displayln (string-append date-print username " signing out. See ya!") out)
|
(displayln (string-append date-print username " signing out. See ya!") out)
|
||||||
(flush-output out)
|
(flush-output out)
|
||||||
(close-output-port error-out)
|
(close-output-port error-out)
|
||||||
|
Loading…
Reference in New Issue
Block a user