~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to gcl-tk/demos/mkEntry.lisp

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;;# mkEntry w
 
2
;;
 
3
;; Create a top-level window that displays a bunch of entries.
 
4
;;
 
5
;; Arguments:
 
6
;;    w -       Name to use for new top-level window.
 
7
 
 
8
(in-package "TK")
 
9
(defun mkEntry (&optional (w '.e1)) 
 
10
    (if (winfo :exists w :return 'boolean) (destroy w))
 
11
    (toplevel w)
 
12
    (dpos w)
 
13
    (wm :title w "Entry Demonstration")
 
14
    (wm :iconname w "Entries")
 
15
    (message (conc w '.msg) :font :Adobe-times-medium-r-normal--*-180* :aspect 200 
 
16
            :text "Three different entries are displayed below.  You can add characters by pointing, clicking and typing.  The usual emacs control characters control editing.   Thus control-b back a char, control-f forward a char, control-a begin line, control-k kill rest of line, control-y yank.   For entries that are too large to fit in the window all at once, you can scan through the entries by dragging with mouse button 2 pressed.  Click the \"OK\" button when you've seen enough.")
 
17
    (frame (conc w '.frame) :borderwidth 10)
 
18
    (button (conc w '.ok) :text "OK" :command (tk-conc "destroy " w))
 
19
    (pack (conc w '.msg) (conc w '.frame) (conc w '.ok) :side "top" :fill "both")
 
20
 
 
21
    (entry (conc w '.frame.e1) :relief "sunken")
 
22
    (entry (conc w '.frame.e2) :relief "sunken")
 
23
    (entry (conc w '.frame.e3) :relief "sunken")
 
24
    (pack (conc w '.frame.e1) (conc w '.frame.e2) (conc w '.frame.e3) :side "top" :pady 5 :fill "x")
 
25
 
 
26
    (funcall (conc w '.frame.e1) :insert 0 "Initial value")
 
27
    (funcall (conc w '.frame.e2) :insert "end" "This entry contains a long value, much too long ")
 
28
    (funcall (conc w '.frame.e2) :insert "end" "to fit in the window at one time, so long in fact ")
 
29
    (funcall (conc w '.frame.e2) :insert "end" "that you'll have to scan or scroll to see the end.")
 
30
)