comparison lispref/frames.texi @ 21007:66d807bdc5b4

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Sat, 28 Feb 1998 01:53:53 +0000
parents 62be63ee468d
children 90da2489c498
comparison
equal deleted inserted replaced
21006:00022857f529 21007:66d807bdc5b4
1 @c -*-texinfo-*- 1 @c -*-texinfo-*-
2 @c This is part of the GNU Emacs Lisp Reference Manual. 2 @c This is part of the GNU Emacs Lisp Reference Manual.
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. 3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998 Free Software Foundation, Inc.
4 @c See the file elisp.texi for copying conditions. 4 @c See the file elisp.texi for copying conditions.
5 @setfilename ../info/frames 5 @setfilename ../info/frames
6 @node Frames, Positions, Windows, Top 6 @node Frames, Positions, Windows, Top
7 @chapter Frames 7 @chapter Frames
8 @cindex frame 8 @cindex frame
47 * Mouse Position:: Asking where the mouse is, or moving it. 47 * Mouse Position:: Asking where the mouse is, or moving it.
48 * Pop-Up Menus:: Displaying a menu for the user to select from. 48 * Pop-Up Menus:: Displaying a menu for the user to select from.
49 * Dialog Boxes:: Displaying a box to ask yes or no. 49 * Dialog Boxes:: Displaying a box to ask yes or no.
50 * Pointer Shapes:: Specifying the shape of the mouse pointer. 50 * Pointer Shapes:: Specifying the shape of the mouse pointer.
51 * X Selections:: Transferring text to and from other X clients. 51 * X Selections:: Transferring text to and from other X clients.
52 * Font Names:: Looking up font names.
52 * Color Names:: Getting the definitions of color names. 53 * Color Names:: Getting the definitions of color names.
53 * Resources:: Getting resource values from the server. 54 * Resources:: Getting resource values from the server.
54 * Server Data:: Getting info about the X server. 55 * Server Data:: Getting info about the X server.
55 @end menu 56 @end menu
56 57
73 The set of possible parameters depends in principle on what kind of 74 The set of possible parameters depends in principle on what kind of
74 window system Emacs uses to display its frames. @xref{X Frame 75 window system Emacs uses to display its frames. @xref{X Frame
75 Parameters}, for documentation of individual parameters you can specify. 76 Parameters}, for documentation of individual parameters you can specify.
76 @end defun 77 @end defun
77 78
79 @tindex before-make-frame-hook
78 @defvar before-make-frame-hook 80 @defvar before-make-frame-hook
79 A normal hook run by @code{make-frame} before it actually creates the 81 A normal hook run by @code{make-frame} before it actually creates the
80 frame. 82 frame.
81 @end defvar 83 @end defvar
82 84
85 @tindex after-make-frame-hook
83 @defvar after-make-frame-hook 86 @defvar after-make-frame-hook
84 A normal hook run by @code{make-frame} after it creates the frame. 87 An abnormal hook run by @code{make-frame} after it creates the frame.
88 Each function in @code{after-make-frame-hook} receives one argument, the
89 frame just created.
85 @end defvar 90 @end defvar
86 91
87 @node Multiple Displays 92 @node Multiple Displays
88 @section Multiple Displays 93 @section Multiple Displays
89 @cindex multiple displays 94 @cindex multiple displays
127 @defun x-open-connection display &optional xrm-string 132 @defun x-open-connection display &optional xrm-string
128 This function opens a connection to the X display @var{display}. It 133 This function opens a connection to the X display @var{display}. It
129 does not create a frame on that display, but it permits you to check 134 does not create a frame on that display, but it permits you to check
130 that communication can be established with that display. 135 that communication can be established with that display.
131 136
132 The optional argument @var{resource-string}, if not @code{nil}, is a 137 The optional argument @var{xrm-string}, if not @code{nil}, is a
133 string of resource names and values, in the same format used in the 138 string of resource names and values, in the same format used in the
134 @file{.Xresources} file. The values you specify override the resource 139 @file{.Xresources} file. The values you specify override the resource
135 values recorded in the X server itself; they apply to all Emacs frames 140 values recorded in the X server itself; they apply to all Emacs frames
136 created on this display. Here's an example of what this string might 141 created on this display. Here's an example of what this string might
137 look like: 142 look like:
263 268
264 If you specify the frame name explicitly when you create the frame, the 269 If you specify the frame name explicitly when you create the frame, the
265 name is also used (instead of the name of the Emacs executable) when 270 name is also used (instead of the name of the Emacs executable) when
266 looking up X resources for the frame. 271 looking up X resources for the frame.
267 272
273 Since a non-window terminal can display only one frame at a time, the
274 frame name appears in the mode line.
275
268 @item display 276 @item display
269 The display on which to open this frame. It should be a string of the 277 The display on which to open this frame. It should be a string of the
270 form @code{"@var{host}:@var{dpy}.@var{screen}"}, just like the 278 form @code{"@var{host}:@var{dpy}.@var{screen}"}, just like the
271 @code{DISPLAY} environment variable. 279 @code{DISPLAY} environment variable.
272 280
354 decide which buffers it should consider, if the predicate is not 362 decide which buffers it should consider, if the predicate is not
355 @code{nil}. It calls the predicate with one arg, a buffer, once for 363 @code{nil}. It calls the predicate with one arg, a buffer, once for
356 each buffer; if the predicate returns a non-@code{nil} value, it 364 each buffer; if the predicate returns a non-@code{nil} value, it
357 considers that buffer. 365 considers that buffer.
358 366
367 @item buffer-list
368 A list of buffers recently selected in this frame.
369
359 @item font 370 @item font
360 The name of the font for displaying text in the frame. This is a 371 The name of the font for displaying text in the frame. This is a
361 string. 372 string.
362 373
363 @item auto-raise 374 @item auto-raise
365 376
366 @item auto-lower 377 @item auto-lower
367 Whether deselecting the frame lowers it (non-@code{nil} means yes). 378 Whether deselecting the frame lowers it (non-@code{nil} means yes).
368 379
369 @item vertical-scroll-bars 380 @item vertical-scroll-bars
370 Whether the frame has scroll bars for vertical scrolling 381 Whether the frame has scroll bars for vertical scrolling, and which side
371 (non-@code{nil} means yes). 382 of the frame they should be on. The possible values are @code{left},
383 @code{right}, and @code{nil} for no scroll bars.
372 384
373 @item horizontal-scroll-bars 385 @item horizontal-scroll-bars
374 Whether the frame has scroll bars for horizontal scrolling 386 Whether the frame has scroll bars for horizontal scrolling
375 (non-@code{nil} means yes). (Horizontal scroll bars are not currently 387 (non-@code{nil} means yes). (Horizontal scroll bars are not currently
376 implemented.) 388 implemented.)
664 676
665 All the non-minibuffer windows in a frame are arranged in a cyclic 677 All the non-minibuffer windows in a frame are arranged in a cyclic
666 order. The order runs from the frame's top window, which is at the 678 order. The order runs from the frame's top window, which is at the
667 upper left corner, down and to the right, until it reaches the window at 679 upper left corner, down and to the right, until it reaches the window at
668 the lower right corner (always the minibuffer window, if the frame has 680 the lower right corner (always the minibuffer window, if the frame has
669 one), and then it moves back to the top. 681 one), and then it moves back to the top. @xref{Cyclic Window Ordering}.
670 682
671 @defun frame-top-window frame 683 @defun frame-top-window frame
672 This returns the topmost, leftmost window of frame @var{frame}. 684 This returns the topmost, leftmost window of frame @var{frame}.
673 @end defun 685 @end defun
674 686
763 Don't call it for any other reason. 775 Don't call it for any other reason.
764 @end deffn 776 @end deffn
765 777
766 @defun redirect-frame-focus frame focus-frame 778 @defun redirect-frame-focus frame focus-frame
767 This function redirects focus from @var{frame} to @var{focus-frame}. 779 This function redirects focus from @var{frame} to @var{focus-frame}.
768 This means that @var{focus-frame} will receive subsequent keystrokes 780 This means that @var{focus-frame} will receive subsequent keystrokes and
769 intended for @var{frame}. After such an event, the value of 781 events intended for @var{frame}. After such an event, the value of
770 @code{last-event-frame} will be @var{focus-frame}. Also, switch-frame 782 @code{last-event-frame} will be @var{focus-frame}. Also, switch-frame
771 events specifying @var{frame} will instead select @var{focus-frame}. 783 events specifying @var{frame} will instead select @var{focus-frame}.
772 784
773 If @var{focus-frame} is @code{nil}, that cancels any existing 785 If @var{focus-frame} is @code{nil}, that cancels any existing
774 redirection for @var{frame}, which therefore once again receives its own 786 redirection for @var{frame}, which therefore once again receives its own
841 changes. @xref{Misc Events}. 853 changes. @xref{Misc Events}.
842 854
843 @node Raising and Lowering 855 @node Raising and Lowering
844 @section Raising and Lowering Frames 856 @section Raising and Lowering Frames
845 857
846 The X Window System uses a desktop metaphor. Part of this metaphor is 858 The X Window System uses a desktop metaphor. Part of this metaphor is
847 the idea that windows are stacked in a notional third dimension 859 the idea that windows are stacked in a notional third dimension
848 perpendicular to the screen surface, and thus ordered from ``highest'' 860 perpendicular to the screen surface, and thus ordered from ``highest''
849 to ``lowest''. Where two windows overlap, the one higher up covers the 861 to ``lowest''. Where two X windows overlap, the one higher up covers
850 one underneath. Even a window at the bottom of the stack can be seen if 862 the one underneath. Even an X window at the bottom of the stack can be
851 no other window overlaps it. 863 seen if no other X window overlaps it.
852 864
853 @cindex raising a frame 865 @cindex raising a frame
854 @cindex lowering a frame 866 @cindex lowering a frame
855 A window's place in this ordering is not fixed; in fact, users tend to 867 An X window's place in this ordering is not fixed; in fact, users tend
856 change the order frequently. @dfn{Raising} a window means moving it 868 to change the order frequently. @dfn{Raising} an X window means moving
857 ``up'', to the top of the stack. @dfn{Lowering} a window means moving 869 it ``up'', to the top of the stack. @dfn{Lowering} an X window means
858 it to the bottom of the stack. This motion is in the notional third 870 moving it to the bottom of the stack. This motion is in the notional
859 dimension only, and does not change the position of the window on the 871 third dimension only, and does not change the position of the X window
860 screen. 872 on the screen.
861 873
862 You can raise and lower Emacs's X windows with these functions: 874 You can raise and lower Emacs's X windows with these functions:
863 875
864 @deffn Command raise-frame frame 876 @deffn Command raise-frame frame
865 This function raises frame @var{frame}. 877 This function raises frame @var{frame}.
1044 1056
1045 Each @var{line} should be a string, and each @var{item} should be the 1057 Each @var{line} should be a string, and each @var{item} should be the
1046 value to return if that @var{line} is chosen. 1058 value to return if that @var{line} is chosen.
1047 @end defun 1059 @end defun
1048 1060
1049 @strong{Usage note:} Don't use @code{x-popup-menu} to display a menu if 1061 @strong{Usage note:} Don't use @code{x-popup-menu} to display a menu
1050 a prefix key with a menu keymap would do the job. If you use a menu 1062 if you could do the job with a prefix key defined with a menu keymap.
1051 keymap to implement a menu, @kbd{C-h c} and @kbd{C-h a} can see the 1063 If you use a menu keymap to implement a menu, @kbd{C-h c} and @kbd{C-h
1052 individual items in that menu and provide help for them. If instead you 1064 a} can see the individual items in that menu and provide help for them.
1053 implement the menu by defining a command that calls @code{x-popup-menu}, 1065 If instead you implement the menu by defining a command that calls
1054 the help facilities cannot know what happens inside that command, so 1066 @code{x-popup-menu}, the help facilities cannot know what happens inside
1055 they cannot give any help for the menu's items. 1067 that command, so they cannot give any help for the menu's items.
1056 1068
1057 The menu bar mechanism, which lets you switch between submenus by 1069 The menu bar mechanism, which lets you switch between submenus by
1058 moving the mouse, cannot look within the definition of a command to see 1070 moving the mouse, cannot look within the definition of a command to see
1059 that it calls @code{x-popup-menu}. Therefore, if you try to implement a 1071 that it calls @code{x-popup-menu}. Therefore, if you try to implement a
1060 submenu using @code{x-popup-menu}, it cannot work with the menu bar in 1072 submenu using @code{x-popup-menu}, it cannot work with the menu bar in
1160 selection. Otherwise, @var{data} may be a string, a symbol, an integer 1172 selection. Otherwise, @var{data} may be a string, a symbol, an integer
1161 (or a cons of two integers or list of two integers), an overlay, or a 1173 (or a cons of two integers or list of two integers), an overlay, or a
1162 cons of two markers pointing to the same buffer. An overlay or a pair 1174 cons of two markers pointing to the same buffer. An overlay or a pair
1163 of markers stands for text in the overlay or between the markers. 1175 of markers stands for text in the overlay or between the markers.
1164 1176
1165 The data may also be a vector of valid non-vector selection values. 1177 The argument @var{data} may also be a vector of valid non-vector
1178 selection values.
1166 1179
1167 Each possible @var{type} has its own selection value, which changes 1180 Each possible @var{type} has its own selection value, which changes
1168 independently. The usual values of @var{type} are @code{PRIMARY} and 1181 independently. The usual values of @var{type} are @code{PRIMARY} and
1169 @code{SECONDARY}; these are symbols with upper-case names, in accord 1182 @code{SECONDARY}; these are symbols with upper-case names, in accord
1170 with X Window System conventions. The default is @code{PRIMARY}. 1183 with X Window System conventions. The default is @code{PRIMARY}.
1199 1212
1200 @defun x-set-cut-buffer string 1213 @defun x-set-cut-buffer string
1201 This function stores @var{string} into the first cut buffer (cut buffer 1214 This function stores @var{string} into the first cut buffer (cut buffer
1202 0), moving the other values down through the series of cut buffers, much 1215 0), moving the other values down through the series of cut buffers, much
1203 like the way successive kills in Emacs move down the kill ring. 1216 like the way successive kills in Emacs move down the kill ring.
1217 @end defun
1218
1219 @node Font Names
1220 @section Looking up Font Names
1221
1222 @defun x-list-font pattern &optional face frame maximum
1223 This function returns a list of available font names that match
1224 @var{pattern}. If the optional arguments FACE and FRAME are specified,
1225 then the list is limited to fonts that are the same size as @var{face}
1226 currently is on @var{frame}.
1227
1228 The argument @var{pattern} should be a string, perhaps with wildcard
1229 characters: the @samp{*} character matches any substring, and the
1230 @samp{?} character matches any single character. Pattern matching
1231 of font names ignores case.
1232
1233 If you specify @var{face} and @var{frame}, @var{face} should be a face name
1234 (a symbol) and @var{frame} should be a frame.
1235
1236 The optional argument @var{maximum} sets a limit on how many fonts to
1237 return. If this is non-@code{nil}, then the return value is truncated
1238 after the first @var{maximum} matching fonts. Specifying a small value
1239 for @var{maximum} can make this function much faster, in cases where
1240 many fonts match the pattern.
1204 @end defun 1241 @end defun
1205 1242
1206 @node Color Names 1243 @node Color Names
1207 @section Color Names 1244 @section Color Names
1208 1245
1272 If you specify them, the key is 1309 If you specify them, the key is
1273 @samp{@var{instance}.@var{component}.@var{attribute}}, and the class is 1310 @samp{@var{instance}.@var{component}.@var{attribute}}, and the class is
1274 @samp{Emacs.@var{class}.@var{subclass}}. 1311 @samp{Emacs.@var{class}.@var{subclass}}.
1275 @end defun 1312 @end defun
1276 1313
1314 @defvar x-resource-class
1315 This variable specifies the application name that @code{x-get-resource}
1316 should look up. The default value is @code{"Emacs"}. You can examine X
1317 resources for application names other than ``Emacs'' by binding this
1318 variable to some other string, around a call to @code{x-get-resource}.
1319 @end defvar
1320
1277 @xref{Resources X,, X Resources, emacs, The GNU Emacs Manual}. 1321 @xref{Resources X,, X Resources, emacs, The GNU Emacs Manual}.
1278 1322
1279 @node Server Data 1323 @node Server Data
1280 @section Data about the X Server 1324 @section Data about the X Server
1281 1325