annotate lisp/generic-widgets.el @ 502:7039e6323819

[xemacs-hg @ 2001-05-04 22:41:46 by ben] ----------------------- byte-comp warning fixes ----------------- New functions for cleanly eliminating byte-compiler warnings. Their definitions require no changes at all in bytecomp.el, meaning that any package that wants to use them and be compatible with older versions of XEmacs need only copy the code and rename the functions (i.e. prefix them with the package name). Eliminate byte-compiler warnings using the new functions in bytecomp-runtime.el. Move coding-system-put,get,category, since they're not Mule-specific and are used in prefer-coding-system. font.el was incredibly ugly. Clean it up. Avoid using defsubst for any exported functions, to avoid possible compatibility problems if we later change the internal interface. (It happened before, with face accessors, between 19.8 and 19.9). Fix tons of warnings. Clean up (new function gpm-is-supported-p eliminates duplicate code in gpm-create/delete-device-hook) and eliminate warnings. ---------- make byte-recompile-directory work in the --------- core `lisp' dir, even in the absence of a Mule XEmacs (i.e. make it skip the Mule files rather than trying to compile them). now you should be able to do `touch *.el' in the `lisp' dir, then M-x byte-recompile-directory, and get no warnings. Avoid trying to compile Mule files in byte-recompile-directory when we're not in a Mule XEmacs, since we're highly likely to get syntax errors. Add a coding-system cookie to all Mule files so that byte-recompile-directory ignores them. Magic cookie function moved to files.el from code-files.el (for use by bytecomp even in a non-coding-system XEmacs), and changed names and semantics for use by bytecomp. NOTE: IMO this is an internal function that we can change as we like (and there is absolutely no code anywhere else using the function). ---------------- GUI improvements: menus, help ------------------- Rearrange order of keymap declarations to be alphabetical. Improve help on help to include all bindings, and group by category. Add bindings for new Info commands. Remove warnings. Use command-hyper-apropos in place of command-apropos. Add a function to do the equivalent of command-apropos. Evals its help-text argument so you can put expressions there. Used now by help-for-help. Add binding to continue text searches. Expand index searches to work over multiple info documents. Add commands to search text/index in User and Lispref. Add new entry, "Uncomment Region" (parallels "Comment Out Region"). Redo Help menu; add bindings for new Info commands to search the index or text of the User and Lispref manuals. Add command for mark-paragraph, activate-region. Make Edit->R accelerator be rectangle, not register (more commonly used), and put rectangle first. Fix the Edit Init File entry to never load the .elc file. Simplify the default-popup-menu. Add Cmds->Tabs menu. Use kp-left not kp_left, etc. ---------------- Miscellaneous bug fixes/cleanup ------------------- byte-compiler-options: Correct doc string. easy-menu-do-define: fix extra quote. fill-paragraph-or-region:Rewrite to be more correct -- use call-interactively so that we always get exactly the same behavior as if the functions were called directly. No need to fiddle with zmacs-region-stays, now that bogus clearing of it (2001-04-28 src/ChangeLog) is removed. Put dialog titles back in -- this time correctly. Fix various other problems with leaks and such. key-sequence-list-description: Clean up fun to always correctly canonicalize. Clean up Kinsoku comments, synch comment-region with FSF 20.7. * simple.el (region-exists-p): * simple.el (region-active-p): Add comment about which one is correct to use in menu specs. * sound.el (load-sound-file): Minor code clean up. * startup.el: * startup.el (command-line-early): * startup.el (initial-scratch-message): Comment changes. Add info about sample.init.el to splash screen. Improve initial-scratch-message and clarify purpose of Scratch buffer. Fix byte-compile warning. ------------------------ Added features ------------------------- Add new variable to control whether etags checks all parent directories for tag files. (On by default.) * hash-table.el: New file, useful utility functions. * dumped-lisp.el (preloaded-file-list): Dump hash-table.el. ------------ notable bug fix: Windows event code -------------- Get critical quit working. ------------ notable bug fix and new feature: regex code -------------- Shy groups were implemented in a horrible, half-assed way that would cause them to screw up regex searching in most cases. Fixed to work correctly. Also extended back-reference syntax past 9. Only is recognized as such if there are at least that many non-shy groups; and optionally will warn about such uses, to catch old code that might be using them differently. (Added variable to control this in search.c -- `warn-about-possibly-incompatible-back- references', on by default for the moment. Declared in lisp.h. ---------------- process/SIGIO improvements ------------------- define USE_GETADDRINFO to replace more complex conditional, and use it. the code conditionalized on this in unix_open_network_stream had *serious* problems handling errors. it's now fixed, and major amounts of duplicate code between the two versions were combined. don't disable SIGIO and other interrupts unless CONNECT_NEEDS_SLOWED_INTERRUPTS is defined -- don't penalize OS's without bugs. similarly for a freebsd bug that was affecting all OS's. * s\ultrix.h: define CONNECT_NEEDS_SLOWED_INTERRUPTS, since that's the OS mentioned as having a kernel bug. * sysdep.c (request_sigio_on_device): * sysdep.c (unrequest_sigio_on_device): fix SIGIO problems on Linux. add check for O_ASYNC in case it's defined and FASYNC isn't. add comment about other ways to do SIGIO on Linux. * callproc.c (Fold_call_process_internal): * process.c (Fstart_process_internal): Deal with the possibility that `default-directory' doesn't have terminating slash. Correct comments about vfork. ---------------- Miscellaneous bug fixes/cleanup ------------------- * callint.c (Finteractive): Add lots of documentation -- exactly what the Lisp equivalents of all the interactive specs are. * console.h (struct console): change type of quit_char to Emchar. * event-msw.c (lstream_type_create_mswindows_selectable): spacing change. Eliminate events-mod.h and combine into events.h. * emacs.c: * emacs.c (make_arg_list_1): * emacs.c (main_1): A couple of char->Extbyte changes, add a comment. * glyphs-msw.c: Correct indentation of function defns to not exceed 80 cols. Try (sort of) to fix some code that sets the colors of the progress gauge. (Commented out) * keymap.c (syms_of_keymap): use DEFSYMBOL. * process.c (read_process_output): No need to fiddle with zmacs_region_stays, now that bogus clearing of it (see below) is removed. * search.c (Freplace_match): warning fix.
author ben
date Fri, 04 May 2001 22:42:35 +0000
parents 0784d089fdc9
children 308d34e9f07d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
1 ;;; generic-widgets.el --- Generic UI building
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
2
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
3 ;; Copyright (C) 2000 Free Software Foundation
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
4
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
5 ;; Maintainer: William Perry <wmperry@gnu.org>
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
6 ;; Keywords: extensions, dumped
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
7
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
8 ;; This file is part of XEmacs.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
9
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
10 ;; XEmacs is free software; you can redistribute it and/or modify it
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
11 ;; under the terms of the GNU General Public License as published by
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
13 ;; any later version.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
14
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
15 ;; XEmacs is distributed in the hope that it will be useful, but
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
18 ;; General Public License for more details.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
19
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
21 ;; along with XEmacs; see the file COPYING. If not, write to the Free
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
22 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
23 ;; 02111-1307, USA.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
24
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
25 ;;; Synched up with: Not in FSF
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
26
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
27 ;;; Commentary:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
28
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
29 ;; This file is dumped with XEmacs.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
30
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
31 (globally-declare-fboundp
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
32 '(gtk-label-new
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
33 gtk-widget-show-all gtk-signal-connect
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
34 gtk-window-new gtk-container-add gtk-vbox-new gtk-hbox-new
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
35 gtk-box-pack-start gtk-notebook-new
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
36 gtk-notebook-set-homogeneous-tabs gtk-notebook-set-scrollable
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
37 gtk-notebook-set-show-tabs gtk-notebook-set-tab-pos
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
38 gtk-notebook-append-page gtk-text-new gtk-text-set-editable
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
39 gtk-text-set-word-wrap gtk-text-set-line-wrap
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
40 gtk-widget-set-style gtk-text-insert gtk-label-set-line-wrap
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
41 gtk-label-set-justify gtk-radio-button-new
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
42 gtk-radio-button-group gtk-check-button-new
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
43 gtk-toggle-button-new gtk-button-new gtk-progress-bar-new
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
44 gtk-progress-bar-set-orientation gtk-progress-bar-set-bar-style))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
45
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
46 (defun build-ui (ui)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
47 (if (null ui)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
48 (gtk-label-new "[empty]")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
49 (let ((builder-func (intern-soft (format "build-ui::%s" (car ui))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
50 (widget nil))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
51 (if (and builder-func (fboundp builder-func))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
52 (progn
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
53 (setq widget (funcall builder-func ui))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
54 (setcdr ui (plist-put (cdr ui) :x-internal-widget widget))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
55 widget)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
56 (error "Unknown ui element: %s" (car ui))))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
57
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
58 (defun show-ui (ui)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
59 (let ((widget (plist-get (cdr ui) :x-internal-widget)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
60 (if (not widget)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
61 (error "Attempting to show unrealized UI"))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
62 (gtk-widget-show-all widget)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
63 (gtk-signal-connect widget 'destroy
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
64 (lambda (widget ui)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
65 (setcdr ui (plist-put (cdr ui) :x-internal-widget nil))) ui)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
66
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
67
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
68 (defun build-ui::window (spec)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
69 "Create a top-level window for containing other widgets.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
70 Properties:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
71 :items list A list of child UI specs. Only the first is used.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
72 :type toplevel/dialog/popup What type of window to create. Window managers
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
73 can (and usually do) treat each type differently.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
74 "
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
75 (let ((plist (cdr spec))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
76 (window nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
77 (child nil))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
78 (setq window (gtk-window-new (plist-get plist :type 'toplevel))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
79 child (build-ui (car (plist-get plist :items))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
80 (gtk-container-add window child)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
81 window))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
82
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
83 (defun build-ui::box (spec)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
84 "Create a box for containing other widgets.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
85 Properties:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
86 :items list A list of child UI specs.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
87 :homogeneous t/nil Whether all children are the same width/height.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
88 :spacing number Spacing between children.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
89 :orientation horizontal/vertical How the widgets are stacked.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
90
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
91 Additional properties on child widgets:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
92 :expand t/nil Whether the new child is to be given extra space
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
93 allocated to box. The extra space will be divided
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
94 evenly between all children of box that use this
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
95 option.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
96 :fill t/nil Whether space given to child by the expand option is
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
97 actually allocated to child, rather than just padding
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
98 it. This parameter has no effect if :expand is set to
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
99 nil. A child is always allocated the full height of a
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
100 horizontal box and the full width of a vertical box.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
101 This option affects the other dimension.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
102 :padding number Extra padding around this widget.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
103 "
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
104 (let* ((plist (cdr spec))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
105 (orientation (plist-get plist :orientation 'horizontal))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
106 (children (plist-get plist :items))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
107 (box nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
108 (child-widget nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
109 (child-plist nil))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
110 (case orientation
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
111 (vertical (setq box (gtk-vbox-new (plist-get plist :homogeneous)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
112 (plist-get plist :spacing))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
113 (horizontal (setq box (gtk-hbox-new (plist-get plist :homogeneous)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
114 (plist-get plist :spacing))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
115 (otherwise (error "Unknown orientation for box: %s" orientation)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
116 (mapc
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
117 (lambda (child)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
118 (setq child-plist (cdr child)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
119 child-widget (build-ui child))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
120 (if (listp child-widget)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
121 (mapc (lambda (w)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
122 (gtk-box-pack-start box w
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
123 (plist-get child-plist :expand)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
124 (plist-get child-plist :fill)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
125 (plist-get child-plist :padding))) child-widget)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
126 (gtk-box-pack-start box child-widget
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
127 (plist-get child-plist :expand)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
128 (plist-get child-plist :fill)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
129 (plist-get child-plist :padding))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
130 children)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
131 box))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
132
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
133 (defun build-ui::tab-control (spec)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
134 "Create a notebook widget.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
135 Properties:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
136 :items list A list of UI specs to use as notebook pages.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
137 :homogeneous t/nil Whether all tabs are the same width.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
138 :orientation top/bottom/left/right Position of tabs
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
139 :show-tabs t/nil Show the tabs on screen?
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
140 :scrollable t/nil Allow scrolling to view all tab widgets?
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
141
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
142 Additional properties on child widgets:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
143 :tab-label ui A UI spec to use for the tab label.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
144 "
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
145 (let* ((plist (cdr spec))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
146 (notebook (gtk-notebook-new))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
147 (children (plist-get plist :items))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
148 (page-counter 1)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
149 (label-widget nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
150 (child-widget nil)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
151 (child-plist nil))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
152 ;; Set all the properties
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
153 (gtk-notebook-set-homogeneous-tabs notebook (plist-get plist :homogeneous))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
154 (gtk-notebook-set-scrollable notebook (plist-get plist :scrollable t))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
155 (gtk-notebook-set-show-tabs notebook (plist-get plist :show-tabs t))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
156 (gtk-notebook-set-tab-pos notebook (plist-get plist :orientation 'top))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
157
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
158 ;; Now fill in the tabs
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
159 (mapc
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
160 (lambda (child)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
161 (setq child-plist (cdr child)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
162 child-widget (build-ui child)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
163 label-widget (build-ui (plist-get child-plist :tab-label
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
164 (list 'label :text (format "tab %d" page-counter))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
165 page-counter (1+ page-counter))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
166 (gtk-notebook-append-page notebook child-widget label-widget))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
167 children)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
168 notebook))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
169
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
170 (defun build-ui::text (spec)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
171 "Create a multi-line text widget.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
172 Properties:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
173 :editable t/nil Whether the user can change the contents
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
174 :word-wrap t/nil Automatic word wrapping?
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
175 :line-wrap t/nil Automatic line wrapping?
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
176 :text string Initial contents of the widget
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
177 :file filename File for initial contents (takes precedence over :text)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
178 :face facename XEmacs face to use in the widget.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
179 "
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
180 (let* ((plist (cdr spec))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
181 (text (gtk-text-new nil nil))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
182 (face (plist-get plist :face 'default))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
183 (info (plist-get plist :text))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
184 (file (plist-get plist :file)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
185 (gtk-text-set-editable text (plist-get plist :editable))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
186 (gtk-text-set-word-wrap text (plist-get plist :word-wrap))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
187 (gtk-text-set-line-wrap text (plist-get plist :line-wrap))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
188 (gtk-widget-set-style text 'default)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
189
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
190 ;; Possible convert the file portion
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
191 (if (and file (not (stringp file)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
192 (setq file (eval file)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
193
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
194 (if (and info (not (stringp info)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
195 (setq info (eval info)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
196
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
197 (if (and file (file-exists-p file) (file-readable-p file))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
198 (save-excursion
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
199 (set-buffer (get-buffer-create " *improbable buffer name*"))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
200 (insert-file-contents file)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
201 (setq info (buffer-string))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
202
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
203 (gtk-text-insert text
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
204 (face-font face)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
205 (face-foreground face)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
206 (face-background face)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
207 info (length info))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
208 text))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
209
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
210 (defun build-ui::label (spec)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
211 "Create a label widget.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
212 Properties:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
213 :text string Text inside the label
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
214 :face facename XEmacs face to use in the widget.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
215 :justification right/left/center How to justify the text.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
216 "
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
217 (let* ((plist (cdr spec))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
218 (label (gtk-label-new (plist-get plist :text))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
219 (gtk-label-set-line-wrap label t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
220 (gtk-label-set-justify label (plist-get plist :justification))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
221 (gtk-widget-set-style label (plist-get plist :face 'default))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
222 label))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
223
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
224 (defun build-ui::pixmap (spec)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
225 "Create a multi-line text widget.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
226 Properties:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
227 :text string Text inside the label
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
228 :face facename XEmacs face to use in the widget.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
229 :justification right/left/center How to justify the text.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
230 "
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
231 (let* ((plist (cdr spec))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
232 (label (gtk-label-new (plist-get plist :text))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
233 (gtk-label-set-line-wrap label t)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
234 (gtk-label-set-justify label (plist-get plist :justification))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
235 (gtk-widget-set-style label (plist-get plist :face 'default))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
236 label))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
237
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
238 (defun build-ui::radio-group (spec)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
239 "A convenience when specifying a group of radio buttons."
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
240 (declare (special build-ui::radio-group))
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
241 (let ((build-ui::radio-group nil))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
242 (mapcar 'build-ui (plist-get (cdr spec) :items))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
243
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
244 (defun build-ui::button (spec)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
245 "Create a button widget.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
246 Properties:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
247 :type radio/check/toggle/nil What type of button to create.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
248 :text string Text in the button.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
249 :glyph glyph Image in the button.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
250 :label ui A UI spec to use for the label.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
251 :relief normal/half/none How to draw button edges.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
252
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
253 NOTE: Radio buttons must be in a radio-group object for them to work.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
254 "
502
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
255 (declare (special build-ui::radio-group))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
256 (let* ((plist (cdr spec))
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
257 (button nil)
7039e6323819 [xemacs-hg @ 2001-05-04 22:41:46 by ben]
ben
parents: 462
diff changeset
258 (button-type (plist-get plist :type 'normal)))
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
259 (case button-type
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
260 (radio
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
261 (if (not (boundp 'build-ui::radio-group))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
262 (error "Attempt to use a radio button outside a radio-group"))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
263 (setq button (gtk-radio-button-new build-ui::radio-group)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
264 build-ui::radio-group (gtk-radio-button-group button)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
265 (check
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
266 (setq button (gtk-check-button-new)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
267 (toggle
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
268 (setq button (gtk-toggle-button-new)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
269 (normal
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
270 (setq button (gtk-button-new)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
271 (otherwise
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
272 (error "Unknown button type: %s" button-type)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
273 (gtk-container-add
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
274 button
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
275 (build-ui (plist-get plist :label
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
276 (list 'label :text
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
277 (plist-get plist
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
278 :text (format "%s button" button-type))))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
279 button))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
280
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
281 (defun build-ui::progress-gauge (spec)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
282 "Create a progress meter.
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
283 Properties:
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
284 :orientation left-to-right/right-to-left/top-to-bottom/bottom-to-top
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
285 :type discrete/continuous
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
286
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
287 "
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
288 (let ((plist (cdr spec))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
289 (gauge (gtk-progress-bar-new)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
290 (gtk-progress-bar-set-orientation gauge (plist-get plist :orientation 'left-to-right))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
291 (gtk-progress-bar-set-bar-style gauge (plist-get plist :type 'continuous))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
292 gauge))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
293
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
294 (provide 'generic-widgets)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
295
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
296 (when (featurep 'gtk) ; just loading this file should be OK
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
297 (gtk-widget-show-all
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
298 (build-ui
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
299 '(window :type dialog
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
300 :items ((tab-control
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
301 :homogeneous t
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
302 :orientation bottom
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
303 :items ((box :orientation vertical
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
304 :tab-label (label :text "vertical")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
305 :items ((label :text "Vertical")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
306 (progress-gauge)
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
307 (label :text "Box stacking")))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
308 (box :orientation horizontal
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
309 :spacing 10
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
310 :items ((label :text "Horizontal box")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
311 (label :text "stacking")))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
312
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
313 (box :orientation vertical
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
314 :items
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
315 ((radio-group
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
316 :items ((button :type radio
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
317 :expand nil
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
318 :fill nil
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
319 :text "Item 1")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
320 (button :type radio
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
321 :expand nil
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
322 :fill nil
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
323 :text "Item 2")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
324 (button :type radio
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
325 :expand nil
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
326 :fill nil
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
327 :text "Item 3")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
328 (button :type radio
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
329 :expand nil
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
330 :fill nil)))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
331 (box :orientation vertical
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
332 :items ((button :type check
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
333 :text "Item 1")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
334 (button :type check
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
335 :text "Item 2")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
336 (button :type normal
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
337 :text "Item 3")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
338 (button :type toggle)))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
339 (text :editable t
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
340 :word-wrap t
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
341 :file (locate-data-file "COPYING"))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
342 (text :editable t
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
343 :face display-time-mail-balloon-enhance-face
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
344 :word-wrap t
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
345 :text "Text with a face on it")))))))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents:
diff changeset
346 )