[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
message loop for --gui-exe compiled code?
I wrote and compiled the following code using `mzc --gui-exe'. The
program, however, didn't wait any input. It terminated immediately.
<<<<
(define frame (make-object frame% "example"))
(send frame show #t)
(define msg (make-object message% "No event" frame))
(make-object button% "btn" frame
(lambda (button event)
(send msg set-label "btn click")))
(make-object button% "exit" frame
(lambda (button event)
(exit)))
>>>>
So I added the following code:
<<<<
(thread (let loop () (sleep 0.03) (yield) (loop)))
>>>>
Though it worked for my small project, I think there must be better way
to do this. If anybody know how to do it, please let me know it.
Thanks in advance
Jong-kyou