stk/STklos/Tk/Composite/Balloon.stklos

68 lines
1.9 KiB
Plaintext

;;;;
;;;; B a l l o o n . s t k l o s -- Help-Balloon class definition
;;;;
;;;; Copyright © 1996-1998 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
;;;;
;;;; Permission to use, copy, and/or distribute this software and its
;;;; documentation for any purpose and without fee is hereby granted, provided
;;;; that both the above copyright notice and this permission notice appear in
;;;; all copies and derived works. Fees for distribution or use of this
;;;; software or derived works may only be charged with express written
;;;; permission of the copyright holder.
;;;; This software is provided ``as is'' without express or implied warranty.
;;;;
;;;; $Id: Balloon.stklos 1.4 Mon, 28 Dec 1998 23:05:11 +0100 eg $
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 23-Oct-1996 17:02
;;;; Last file update: 27-Dec-1998 18:46
;;;;
(require "balloon")
(require "Basics")
(select-module STklos+Tk)
(export add-balloon)
;=============================================================================
;
; <Help-Balloon>
;
;=============================================================================
;;;;
;;;; Class definition
;;;;
(define-class <Help-Balloon> (<Label>)
((label :accessor label-of)
(delay :initform 1000 ; ms
:init-keyword :delay
:accessor delay)))
;;
;; Initialize-composite-widget
;;
(define-method initialize-composite-widget ((self <Help-balloon>) initargs parent)
(next-method)
(slot-set! self 'Id (slot-ref (find-balloon-help) 'Id)))
;;
;; Add-balloon
;;
(define-method add-balloon ((self <Help-Balloon>) who txt)
(add-balloon-help (Id who) txt (delay self) (background self)))
(provide "Balloon")
#|
Example:
(define b (make <Help-Balloon> :background "PaleGreen"))
(define b1 (make <Button> :text "B1"))
(define b2 (make <Button> :text "B2"))
(pack b1 b2 :side "left")
(add-balloon b b1 "This is button b1")
(add-balloon b b2 "This one is\n called b2")
|#