From b8ebf8b909e5964d8cb6cd4749040a216e279c3a Mon Sep 17 00:00:00 2001 From: frese Date: Tue, 15 Apr 2003 16:08:17 +0000 Subject: [PATCH] added buttons (not finished) --- src/titlebar.scm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/titlebar.scm b/src/titlebar.scm index 60c2039..3c7349f 100644 --- a/src/titlebar.scm +++ b/src/titlebar.scm @@ -1,5 +1,5 @@ (define-options-spec titlebar-options-spec - (buttons symbol-list '(kill)) ; iconize, maximize, roll + (buttons symbol-list '(kill)) ; kill, iconize, maximize (normal-colors colors '("#aaaaaa" "#eeeeee" "#777777" "black")) (active-colors colors '("#9999aa" "#eeeeff" "#777788" "black")) (focused-colors colors '("#666699" "#aaaacc" "#333366" "#eeeeee")) @@ -26,9 +26,21 @@ options-def)) (gc (create-gc dpy window '())) (tb (make-titlebar in-channel dpy window "test" 'normal)) - ;; buttons... icon-window... + (button-channel out-channel) + (button-size 13) ;; TODO has to be calculated from window-height + (buttons (map (lambda (id i) + (create-button dpy window colormap + (make-rectangle + (+ 2 (* i (+ 2 button-size))) + 2 button-size button-size) + button-channel id + ;; TODO: border-style -> colors + `((content . ,id)))) + (get-option-value options 'buttons) + (iota (length (get-option-value options 'buttons))))) + ;; icon-window... ) - (mdisplay "creating titlebar " window "\n") + (for-each map-button buttons) (spawn* (list 'titlebar window) (lambda (release)