;;;;
;;;; L e n t r y  . s t k 	  --  Labeled Entry composite widget
;;;;
;;;; Copyright (C) 1993,1994,1995 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.
;;;;
;;;;           Author: Erick Gallesio [eg@kaolin.unice.fr]
;;;;    Creation date: 22-Mar-1994 13:05
;;;; Last file update: 14-Dec-1994 17:44

(require "Entry")
(require "Frame")
(require "Button")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; <Labeled-Entry> class definition
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(define-class <Labeled-entry> (<Tk-composite-widget> <Entry>)
  ((entry 	 :accessor   entry-of)
   (label	 :accessor   label-of)
   ;; Fictive slots
   (title	 :accessor     title
		 :init-keyword :title
		 :allocation   :propagated
		 :propagate-to ((label text)))
   (background   :accessor     background
		 :init-keyword :background
		 :allocation   :propagated
		 :propagate-to (frame entry label))
   (foreground   :accessor     foreground
		 :init-keyword :foreground
		 :allocation   :propagated
		 :propagate-to (entry label))
   (border-width :accessor     border-width 
		 :allocation   :propagated
		 :init-keyword :border-width
		 :propagate-to (frame))
   (relief	 :accessor     relief
		 :init-keyword :relief
		 :allocation   :propagated
		 :propagate-to (frame))))

(define-method initialize-composite-widget ((self <Labeled-entry>) initargs frame)
  (let* ((e (make <Entry> :parent frame :relief "ridge"))
	 (l (make <Label> :parent frame)))

    (pack l :side "left"  :padx 5 :pady 5)
    (pack e :side "right" :padx 5 :pady 5 :expand #t :fill "x")

    (slot-set! self 'Id     (Id e))
    (slot-set! self 'entry  e)
    (slot-set! self 'label  l)))

(provide "Lentry")
