stk/STklos/Tk/Composite/Balloon.stklos

67 lines
1.8 KiB
Plaintext
Raw Normal View History

1998-04-10 06:59:06 -04:00
;;;;
;;;; B a l l o o n . s t k l o s -- Help-Balloon class definition
;;;;
1999-09-05 07:16:41 -04:00
;;;; Copyright <20> 1996-1999 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
1998-04-10 06:59:06 -04:00
;;;;
1999-09-05 07:16:41 -04:00
;;;; 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.
1998-04-10 06:59:06 -04:00
;;;;
;;;; Author: Erick Gallesio [eg@unice.fr]
;;;; Creation date: 23-Oct-1996 17:02
1999-09-05 07:16:41 -04:00
;;;; Last file update: 3-Sep-1999 20:12 (eg)
1998-04-10 06:59:06 -04:00
;;;;
1999-02-02 06:13:40 -05:00
(require "balloon")
1998-04-10 06:59:06 -04:00
(require "Basics")
(select-module STklos+Tk)
(export add-balloon)
;=============================================================================
;
; <Help-Balloon>
;
;=============================================================================
;;;;
;;;; Class definition
;;;;
1999-02-02 06:13:40 -05:00
(define-class <Help-Balloon> (<Label>)
1998-04-10 06:59:06 -04:00
((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)
1999-02-02 06:13:40 -05:00
(next-method)
(slot-set! self 'Id (slot-ref (find-balloon-help) 'Id)))
1998-04-10 06:59:06 -04:00
;;
;; Add-balloon
;;
(define-method add-balloon ((self <Help-Balloon>) who txt)
1999-02-02 06:13:40 -05:00
(add-balloon-help (Id who) txt (delay self) (background self)))
1998-04-10 06:59:06 -04:00
(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")
|#