Callback based error handler in factory
parent
71b59977ad
commit
79266b58cf
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue