;******************************************************************************
;
; File name    : mkEntry2.stk
; Creation     : Jul-29-1993
; Modification : Jul-29-1993
;
;******************************************************************************
;
; STk adaptation of the Tk widget demo.
;
; mkEntry2:
; Create a top-level window that displays a bunch of entries with scrollbars.
;
;******************************************************************************

(provide "mkEntry2")

(define (mkEntry2)
  (catch (destroy .top-entry2))
  (toplevel ".top-entry2")
  (dpos .top-entry2)
  (wm 'title .top-entry2 "Entry Demonstration")
  (wm 'iconname .top-entry2 "Entries")
  (message ".top-entry2.m" 
	   :font "-Adobe-times-medium-r-normal--*-180*"
	   :aspect 200
	   :text "Three different entries are displayed below.  You can add characters by pointing, clicking and typing.  You can delete by selecting and typing Control-w.  Backspace, Control-h, and Delete may be typed to erase the character just before the insertion point, Control-k erases all the chars from the insertion point to the end, and Control-g clears the entry. For entries that are too large to fit in the window all at once, you can scan through the entries by dragging with <Shift> key and mouse button 2 pressed.\n\nClick the \"OK\" button when you've seen enough.")

  (frame ".top-entry2.f" :borderwidth 10)
  (button ".top-entry2.ok" :text "OK" :command '(destroy .top-entry2))
  (pack .top-entry2.m .top-entry2.f .top-entry2.ok :side "top" :fill "both")

  (entry ".top-entry2.f.e1" :relief "sunken" :scroll ".top-entry2.f.s1 'set")
  (scrollbar ".top-entry2.f.s1"
	     :relief "sunken" :orient "horizontal"
	     :command ".top-entry2.f.e1 'view")
  (frame ".top-entry2.f.f1" :geometry "20x10")
  (entry ".top-entry2.f.e2"
	 :relief "sunken" :scroll ".top-entry2.f.s2 'set")
  (scrollbar ".top-entry2.f.s2" 
	     :relief "sunken" :orient "horizontal"
	     :command ".top-entry2.f.e2 'view")
  (frame ".top-entry2.f.f2" :geometry "20x10")
  (entry ".top-entry2.f.e3"
	 :relief "sunken" :scroll ".top-entry2.f.s3 'set")
  (scrollbar ".top-entry2.f.s3"
	     :relief "sunken" :orient "horizontal"
	     :command ".top-entry2.f.e3 'view")
  (pack .top-entry2.f.e1 .top-entry2.f.s1 .top-entry2.f.f1 .top-entry2.f.e2
	.top-entry2.f.s2 .top-entry2.f.f2 .top-entry2.f.e3 .top-entry2.f.s3
	:side "top" :fill "x")

  (.top-entry2.f.e1 'insert 0 "Initial value")
  (.top-entry2.f.e2 'insert 'end 
		   "This entry contains a long value, much too long ")
  (.top-entry2.f.e2 'insert 'end
		   "to fit in the window at one time, so long in fact ")
  (.top-entry2.f.e2 'insert 'end
		   "that you'll have to scan or scroll to see the end."))
