98
|
1 ;;; widget.el --- a library of user interface components.
|
|
2 ;;
|
|
3 ;; Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
|
4 ;;
|
|
5 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
|
195
|
6 ;; Maintainer: Hrvoje Niksic <hniksic@srce.hr>
|
98
|
7 ;; Keywords: help, extensions, faces, hypermedia
|
195
|
8 ;; Version: 1.9960-x
|
98
|
9 ;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
|
|
10
|
195
|
11 ;; This file is part of XEmacs.
|
149
|
12
|
195
|
13 ;; XEmacs is free software; you can redistribute it and/or modify
|
149
|
14 ;; it under the terms of the GNU General Public License as published by
|
|
15 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
16 ;; any later version.
|
|
17
|
195
|
18 ;; XEmacs is distributed in the hope that it will be useful,
|
149
|
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21 ;; GNU General Public License for more details.
|
|
22
|
|
23 ;; You should have received a copy of the GNU General Public License
|
195
|
24 ;; along with XEmacs; see the file COPYING. If not, write to the
|
149
|
25 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
26 ;; Boston, MA 02111-1307, USA.
|
|
27
|
98
|
28 ;;; Commentary:
|
|
29 ;;
|
|
30 ;; If you want to use this code, please visit the URL above.
|
|
31 ;;
|
|
32 ;; This file only contain the code needed to define new widget types.
|
106
|
33 ;; Everything else is autoloaded from `wid-edit.el'.
|
98
|
34
|
|
35 ;;; Code:
|
|
36
|
197
|
37 ;; Neither XEmacs, nor latest GNU Emacs need this -- provided for
|
|
38 ;; compatibility.
|
|
39 ;; (defalias 'define-widget-keywords 'ignore)
|
|
40
|
|
41 (defmacro define-widget-keywords (&rest keys)
|
|
42 "This doesn't do anything in Emacs 20 or XEmacs."
|
|
43 (`
|
|
44 (eval-and-compile
|
|
45 (let ((keywords (quote (, keys))))
|
|
46 (while keywords
|
|
47 (or (boundp (car keywords))
|
|
48 (set (car keywords) (car keywords)))
|
|
49 (setq keywords (cdr keywords)))))))
|
98
|
50
|
|
51 (defun define-widget (name class doc &rest args)
|
|
52 "Define a new widget type named NAME from CLASS.
|
|
53
|
|
54 NAME and CLASS should both be symbols, CLASS should be one of the
|
|
55 existing widget types, or nil to create the widget from scratch.
|
|
56
|
|
57 After the new widget has been defined, the following two calls will
|
|
58 create identical widgets:
|
|
59
|
|
60 * (widget-create NAME)
|
|
61
|
|
62 * (apply 'widget-create CLASS ARGS)
|
|
63
|
|
64 The third argument DOC is a documentation string for the widget."
|
|
65 (put name 'widget-type (cons class args))
|
149
|
66 (put name 'widget-documentation doc)
|
|
67 name)
|
98
|
68
|
|
69 ;;; The End.
|
|
70
|
|
71 (provide 'widget)
|
|
72
|
|
73 ;; widget.el ends here
|