;;;; ;;;; T o o l b a r . s t k l o s -- Tool bar management ;;;; ;;;; Copyright © 1999 Erick Gallesio - I3S-CNRS/ESSI ;;;; ;;;; Permission to use, copy, modify, distribute,and license this ;;;; software and its documentation for any purpose is hereby granted, ;;;; provided that existing copyright notices are retained in all ;;;; copies and that this notice is included verbatim in any ;;;; distributions. No written agreement, license, or royalty fee is ;;;; required for any of the authorized uses. ;;;; This software is provided ``AS IS'' without express or implied ;;;; warranty. ;;;; ;;;; Author: Erick Gallesio [eg@unice.fr] ;;;; Creation date: 06-May-1999 15:08 ;;;; Last file update: 3-Sep-1999 20:15 (eg) ;;;; (require "Basics") (require "palette") (require "balloon") (select-module STklos+Tk) (export make-toolbar default-release-toolbar toolbar-item) #| FIXME: ° resources are not taken into account. Why? |# ;;; ;;; Resources ;;; ;(option 'add "*ToolBar*Relief" "ridge" "widgetDefault") ;(option 'add "*ToolBar*BorderWidth" "1" "widgetDefault") ;;; ;;; Tool-bar default bindings ;;; (bind "ToolBar" "" (lambda (|W|) (tk-set! |W| :relief "raised"))) (bind "ToolBar" "" (lambda (|W|) (tk-set! |W| :relief "flat"))) ;============================================================================= ; ; Class ; ;============================================================================= (define-class () ((%handle :init-form #f) (%float :init-form #f) (%clone :init-form #f) (%components :init-form '()) (class :init-keyword :class :init-form "ToolBar") (orientation :init-form "horizontal" :accessor orientation :init-keyword :orientation) (balloon-color :init-keyword :balloon-color ; Not settable by resources!! :init-form "#ffffb0") (press-command :init-form #f :accessor press-command :init-keyword :press-command) (release-command :init-form #f :accessor release-command :init-keyword :release-command))) (define-method initialize ((self ) initargs) (next-method) ;; Create the handle to detach the tool bar (let ((h (make