Callback based error handler in factory

darcs
wayo.cavazos 2006-02-23 23:20:46 +00:00
parent 71b59977ad
commit 79266b58cf
1 changed files with 11 additions and 4 deletions

View File

@ -1,6 +1,6 @@
USING: kernel namespaces generic math sequences hashtables io arrays words USING: kernel alien compiler namespaces generic math sequences hashtables io
prettyprint lists concurrency rectangle arrays words prettyprint lists concurrency
xlib x concurrent-widgets simple-error-handler ; process rectangle xlib x concurrent-widgets ;
IN: factory IN: factory
@ -579,9 +579,16 @@ SYMBOL: window-list
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: xlib-error-handler ( -- xt ) "void" { "Display*" "XErrorEvent*" }
[ "X11 : error-handler called" print flush ] alien-callback ; compiled
: install-error-handler ( -- ) xlib-error-handler XSetErrorHandler drop ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: start-factory ( dpy-string -- ) : start-factory ( dpy-string -- )
initialize-x initialize-x
SetSimpleErrorHandler install-error-handler
root get [ make-drag-gc ] with-win drag-gc set root get [ make-drag-gc ] with-win drag-gc set
root get [ black-pixel get set-window-background clear-window ] with-win root get [ black-pixel get set-window-background clear-window ] with-win
root get create-wm-root root get create-wm-root