2003-08-19 15:19:38 -04:00
|
|
|
;;; -*-Scheme-*-
|
|
|
|
;;;
|
|
|
|
;;; The Scheme part of the Xt extension.
|
|
|
|
|
2003-09-04 08:45:48 -04:00
|
|
|
(define widgets (if (feature? 'motif) 'motif 'xaw))
|
|
|
|
|
|
|
|
(require 'xlib)
|
2003-09-28 06:00:48 -04:00
|
|
|
(require (string->symbol (format #f "~a.la" widgets)))
|
2003-09-04 08:45:48 -04:00
|
|
|
|
|
|
|
(provide 'xwidgets)
|
2003-08-19 15:19:38 -04:00
|
|
|
|
|
|
|
(define (manage-child w)
|
|
|
|
(manage-children (list w)))
|
|
|
|
|
|
|
|
(define (unmanage-child w)
|
|
|
|
(unmanage-children (list w)))
|
|
|
|
|
|
|
|
(define (add-callback w name fun)
|
|
|
|
(add-callbacks w name (list fun)))
|
|
|
|
|
|
|
|
(define (create-managed-widget . args)
|
|
|
|
(let ((w (apply create-widget args)))
|
|
|
|
(manage-child w)
|
|
|
|
w))
|
|
|
|
|
|
|
|
(define application-initialize #f)
|
|
|
|
|
|
|
|
(let ((con) (dpy) (app-class #f) (shell-class #f))
|
|
|
|
(set! application-initialize
|
|
|
|
(lambda (name . fallback-res)
|
|
|
|
(set! con (create-context))
|
|
|
|
(if (not (null? fallback-res))
|
|
|
|
(apply set-context-fallback-resources! con fallback-res))
|
|
|
|
(set! dpy (initialize-display con #f name app-class))
|
|
|
|
(create-shell name shell-class (find-class 'application-shell) dpy))))
|
|
|
|
|
|
|
|
;; Backwards compatibility:
|
|
|
|
|
|
|
|
(define widget-window widget->window)
|