A wrapper for `The Simple X library' by Dominic Giampaolo.The library code itself is included in the egg.
(sx:add-time-out UNSIGNED-LONG TOPROC) (sx:attach-edge SXWIDGET INT INT) (sx:author) -> C-STRING (sx:beep) (sx:change-scroll-list SXWIDGET STRINGLIST) (sx:check-for-event) (sx:clear-draw-area) (sx:close-window) (sx:draw-arc INT INT INT INT INT INT) (sx:draw-bitmap (POINTER VOID) INT INT INT INT) (sx:draw-box INT INT INT INT) (sx:draw-filled-arc INT INT INT INT INT INT) (sx:draw-filled-box INT INT INT INT) (sx:draw-filled-polygon S16VECTOR INT) (sx:draw-image (POINTER VOID) INT INT INT INT) (sx:draw-line INT INT INT INT) (sx:draw-pixel INT INT) (sx:draw-polyline S16VECTOR INT) (sx:draw-text C-STRING INT INT) (sx:exit-main-loop) (sx:font-height (POINTER "XFONTSTRUCT")) -> INT (sx:free-all-colors) (sx:free-font SXFONT) (sx:free-private-color INT) (sx:free-standard-colors) (sx:get-all-colors) -> BOOL (sx:get-bg-color SXWIDGET) -> INT (sx:get-current-list-item SXWIDGET) -> INT (sx:get-draw-area-size S32VECTOR S32VECTOR) (sx:get-fg-color SXWIDGET) -> INT (sx:get-file C-STRING C-STRING FREQPROC) -> C-STRING (sx:get-font C-STRING) -> SXFONT (sx:get-form) -> SXWIDGET (sx:get-image (POINTER VOID) INT INT INT INT) (sx:get-long-string C-STRING C-STRING INT) -> C-STRING (sx:get-menu-item-checked SXWIDGET) -> BOOL (sx:get-named-color C-STRING) -> INT (sx:get-okay C-STRING) -> BOOL (sx:get-pixel INT INT) -> INT (sx:get-private-color) -> INT (sx:get-rgbcolor INT INT INT) -> INT (sx:get-standard-colors) (sx:get-string C-STRING C-STRING) -> C-STRING (sx:get-string-entry SXWIDGET) -> C-STRING (sx:get-text C-STRING C-STRING INT INT) -> C-STRING (sx:get-text-widget-text SXWIDGET) -> C-STRING (sx:get-toggle-state SXWIDGET) -> BOOL (sx:get-top-widget SXWIDGET) -> SXWIDGET (sx:get-tri-state C-STRING) -> INT (sx:get-widget-font SXWIDGET) -> SXFONT (sx:get-widget-state SXWIDGET) -> BOOL (sx:get-yes-no C-STRING) -> BOOL (sx:grab-pixel C-STRING) -> C-STRING (sx:lib-version) -> C-STRING (sx:main-loop) (sx:make-button C-STRING BUTTONPROC) -> SXWIDGET (sx:make-draw-area INT INT REDISPLAYPROC) -> SXWIDGET (sx:make-form SXWIDGET) -> SXWIDGET (sx:make-horiz-scrollbar INT SCROLLPROC) -> SXWIDGET (sx:make-label C-STRING) -> SXWIDGET (sx:make-menu C-STRING) -> SXWIDGET (sx:make-menu-item SXWIDGET C-STRING BUTTONPROC) -> SXWIDGET (sx:make-scroll-list STRINGLIST INT INT SCROLLPROC) -> SXWIDGET (sx:make-string-entry C-STRING INT STRINGPROC) -> SXWIDGET (sx:make-stringlist SCHEME-OBJECT) -> (POINTER (POINTER CHAR)) (sx:make-text-widget C-STRING BOOL BOOL INT INT) -> SXWIDGET (sx:make-toggle C-STRING BOOL SXWIDGET BUTTONPROC) -> SXWIDGET (sx:make-vert-scrollbar INT SCROLLPROC) -> SXWIDGET (sx:make-window C-STRING C-STRING BOOL) -> SXWIDGET (sx:open-display INT (POINTER (POINTER CHAR))) -> INT (sx:read-locale C-STRING) (sx:scroll-draw-area INT INT INT INT INT INT) (sx:set-bg-color SXWIDGET INT) (sx:set-border-color SXWIDGET INT) (sx:set-button-down-cb SXWIDGET MOUSEBUTTONPROC) (sx:set-button-up-cb SXWIDGET MOUSEBUTTONPROC) (sx:set-color INT) (sx:set-color-map INT) (sx:set-current-list-item SXWIDGET INT) (sx:set-current-window SXWIDGET) (sx:set-draw-area SXWIDGET) (sx:set-draw-mode INT) (sx:set-enter-cb SXWIDGET ENTERPROC) (sx:set-fg-color SXWIDGET INT) (sx:set-form SXWIDGET) (sx:set-freq-filter C-STRING) (sx:set-icon-title C-STRING) (sx:set-keypress-cb SXWIDGET KEYPROC) (sx:set-label SXWIDGET C-STRING) (sx:set-leave-cb SXWIDGET LEAVEPROC) (sx:set-line-style INT) (sx:set-line-width INT) (sx:set-menu-item-checked SXWIDGET BOOL) (sx:set-mouse-motion-cb SXWIDGET MOTIONPROC) (sx:set-my-color-map INT U8VECTOR U8VECTOR U8VECTOR) (sx:set-private-color INT INT INT INT) (sx:set-scrollbar SXWIDGET FLOAT FLOAT FLOAT) (sx:set-scrollbar-direction FLOAT) (sx:set-scrollbar-step SXWIDGET FLOAT) (sx:set-string-entry SXWIDGET C-STRING) (sx:set-text-editable SXWIDGET BOOL) (sx:set-text-widget-position SXWIDGET INT) (sx:set-text-widget-text SXWIDGET C-STRING BOOL) (sx:set-thumb-bitmap SXWIDGET C-STRING INT INT) (sx:set-toggle-state SXWIDGET BOOL) (sx:set-widget-bitmap SXWIDGET (POINTER VOID) INT INT) (sx:set-widget-font SXWIDGET SXFONT) (sx:set-widget-pixmap SXWIDGET (POINTER (POINTER VOID))) (sx:set-widget-pos SXWIDGET INT SXWIDGET [INT SXWIDGET]) (sx:set-widget-size SXWIDGET INT INT) (sx:set-widget-state SXWIDGET BOOL) (sx:set-window-title C-STRING) (sx:show-display) (sx:sync-display) (sx:text-width SXFONT C-STRING) -> INT (sx:turn-on-backing-store SXWIDGET) -> INT
TOPROC = (lambda () ...) FREQPROC = (lambda (directory file) ...) BUTTONPROC = (lambda () ...) MOUSEBUTTONPROC = (lambda (button x y) ...) REDISPLAYPROC = (lambda (width height) ...) STRINGPROC = (lambda (string) ...) SCROLLPROC = (lambda (float-val) ...) ENTERPPROC = (lambda (x y) ...) LEAVEPROC = (lambda (x y) ...) KEYPROC = (lambda (inputstring up?) ...) MOTIONPROC = (lambda (x y) ...)
sx:attach-bottom sx:attach-left sx:attach-right sx:attach-top sx:black sx:blue sx:bottom-edge sx:buttonbg sx:can-modify sx:colsel-dial sx:edit-file sx:edit-string sx:exclusive-window sx:freq-dial sx:green sx:grey-scale-1 sx:grey-scale-2 sx:hilight sx:inputbg sx:left-edge sx:main-dial sx:no-care sx:no-modify sx:nonexclusive-window sx:num-dial sx:place-right sx:place-under sx:popup-dial sx:rainbow-1 sx:rainbow-2 sx:red sx:right-edge sx:sane-xor sx:top-edge sx:white sx:yellow
A simple `Hello world' example:
(require-extension sx) (sx:make-label "Hello, world!") (sx:main-loop)
Show current directory in scroll-list:
(require-extension sx posix (srfi 1)) (define (button) (sx:change-scroll-list sl (directory ".")) ) (define (scroll s i) (print "current: " s " \t" i) ) (define b (sx:make-button "Update" button)) (define sl (sx:make-scroll-list (directory ".") 200 300 scroll)) (sx:set-widget-pos sl sx:place-under b) (sx:main-loop)
Copyright (c) 2005, Dominic Giampaolo This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA All rights reserved.