comparison lispref/frames.texi @ 8427:bc548090f760

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Wed, 03 Aug 1994 00:12:07 +0000
parents bf6ecdddf78b
children 9bc99cd7a6ee
comparison
equal deleted inserted replaced
8426:3abe02e03dc8 8427:bc548090f760
7 @chapter Frames 7 @chapter Frames
8 @cindex frame 8 @cindex frame
9 9
10 A @var{frame} is a rectangle on the screen that contains one or more 10 A @var{frame} is a rectangle on the screen that contains one or more
11 Emacs windows. A frame initially contains a single main window (plus 11 Emacs windows. A frame initially contains a single main window (plus
12 perhaps a minibuffer window) which you can subdivide vertically or 12 perhaps a minibuffer window), which you can subdivide vertically or
13 horizontally into smaller windows. 13 horizontally into smaller windows.
14 14
15 @cindex terminal frame 15 @cindex terminal frame
16 @cindex X window frame 16 @cindex X window frame
17 When Emacs runs on a text-only terminal, it has just one frame, a 17 When Emacs runs on a text-only terminal, it has just one frame, a
64 not mentioned in @var{alist} default according to the value of the 64 not mentioned in @var{alist} default according to the value of the
65 variable @code{default-frame-alist}; parameters not specified there 65 variable @code{default-frame-alist}; parameters not specified there
66 either default from the standard X defaults file and X resources. 66 either default from the standard X defaults file and X resources.
67 67
68 The set of possible parameters depends in principle on what kind of 68 The set of possible parameters depends in principle on what kind of
69 window system Emacs uses to display its the frames. @xref{X Frame 69 window system Emacs uses to display its frames. @xref{X Frame
70 Parameters}, for documentation of individual parameters you can specify 70 Parameters}, for documentation of individual parameters you can specify
71 when creating an X window frame. 71 when creating an X window frame.
72 @end defun 72 @end defun
73 73
74 @defvar before-make-frame-hook 74 @defvar before-make-frame-hook
249 @item icon-type 249 @item icon-type
250 The type of icon to use for this frame when it is iconified. 250 The type of icon to use for this frame when it is iconified.
251 Non-@code{nil} specifies a bitmap icon, @code{nil} a text icon. 251 Non-@code{nil} specifies a bitmap icon, @code{nil} a text icon.
252 252
253 @item foreground-color 253 @item foreground-color
254 The color to use for the inside of a character. This is a string; the X 254 The color to use for the image of a character. This is a string; the X
255 server defines the meaningful color names. 255 server defines the meaningful color names.
256 256
257 @item background-color 257 @item background-color
258 The color to use for the background of text. 258 The color to use for the background of characters.
259 259
260 @item mouse-color 260 @item mouse-color
261 The color for the mouse pointer. 261 The color for the mouse pointer.
262 262
263 @item cursor-color 263 @item cursor-color
301 301
302 @node Size and Position 302 @node Size and Position
303 @subsection Frame Size And Position 303 @subsection Frame Size And Position
304 304
305 You can read or change the size and position of a frame using the 305 You can read or change the size and position of a frame using the
306 frame parameters @code{left}, @code{top}, @code{height} and 306 frame parameters @code{left}, @code{top}, @code{height}, and
307 @code{width}. Whatever geometry parameters you don't specify are chosen 307 @code{width}. Whatever geometry parameters you don't specify are chosen
308 by the window manager in its usual fashion. 308 by the window manager in its usual fashion.
309 309
310 Here are some special features for working with sizes and positions: 310 Here are some special features for working with sizes and positions:
311 311
312 @defun set-frame-position frame left top 312 @defun set-frame-position frame left top
313 This function sets the position of the top left corner of 313 This function sets the position of the top left corner of
314 @var{frame}---to @var{left} and @var{top}. These arguments are measured 314 @var{frame} to @var{left} and @var{top}. These arguments are measured
315 in pixels, counting from the top left corner of the screen. 315 in pixels, counting from the top left corner of the screen.
316 @end defun 316 @end defun
317 317
318 @defun frame-height &optional frame 318 @defun frame-height &optional frame
319 @defunx frame-width &optional frame 319 @defunx frame-width &optional frame
328 pixels. If you don't supply @var{frame}, they use the selected frame. 328 pixels. If you don't supply @var{frame}, they use the selected frame.
329 @end defun 329 @end defun
330 330
331 @defun frame-char-height &optional frame 331 @defun frame-char-height &optional frame
332 @defunx frame-char-width &optional frame 332 @defunx frame-char-width &optional frame
333 These functions return the height and width, respectively, of a 333 These functions return the height and width of a character in
334 character in @var{frame}, measured in pixels. The values depend on the 334 @var{frame}, measured in pixels. The values depend on the choice of
335 choice of font. If you don't supply @var{frame}, these functions use 335 font. If you don't supply @var{frame}, these functions use the selected
336 the selected frame. 336 frame.
337 @end defun 337 @end defun
338 338
339 @defun set-frame-size frame cols rows 339 @defun set-frame-size frame cols rows
340 This function sets the size of @var{frame}, measured in characters; 340 This function sets the size of @var{frame}, measured in characters;
341 @var{cols} and @var{rows} specify the new width and height. 341 @var{cols} and @var{rows} specify the new width and height.
352 Size}. 352 Size}.
353 353
354 @defun x-parse-geometry geom 354 @defun x-parse-geometry geom
355 @cindex geometry specification 355 @cindex geometry specification
356 The function @code{x-parse-geometry} converts a standard X windows 356 The function @code{x-parse-geometry} converts a standard X windows
357 geometry string to an alist which you can use as part of the argument to 357 geometry string to an alist that you can use as part of the argument to
358 @code{make-frame}. 358 @code{make-frame}.
359 359
360 The alist describes which parameters were specified in @var{geom}, and 360 The alist describes which parameters were specified in @var{geom}, and
361 gives the values specified for them. Each element looks like 361 gives the values specified for them. Each element looks like
362 @code{(@var{parameter} . @var{value})}. The possible @var{parameter} 362 @code{(@var{parameter} . @var{value})}. The possible @var{parameter}
452 the lower right corner (always the minibuffer window, if the frame has 452 the lower right corner (always the minibuffer window, if the frame has
453 one), and then it moves back to the top. 453 one), and then it moves back to the top.
454 454
455 @defun frame-top-window frame 455 @defun frame-top-window frame
456 This returns the topmost, leftmost window of frame @var{frame}. 456 This returns the topmost, leftmost window of frame @var{frame}.
457 This is a window
458 @end defun 457 @end defun
459 458
460 At any time, exactly one window on any frame is @dfn{selected within the 459 At any time, exactly one window on any frame is @dfn{selected within the
461 frame}. The significance of this designation is that selecting the 460 frame}. The significance of this designation is that selecting the
462 frame also selects this window. You can get the frame's current 461 frame also selects this window. You can get the frame's current
463 selected window with @code{frame-selected-window}. 462 selected window with @code{frame-selected-window}.
464 463
465 @defun frame-selected-window frame 464 @defun frame-selected-window frame
466 This function returns the window on @var{frame} which is selected within 465 This function returns the window on @var{frame} that is selected within
467 @var{frame}. 466 @var{frame}.
468 @end defun 467 @end defun
469 468
470 Conversely, selecting a window for Emacs with @code{select-window} also 469 Conversely, selecting a window for Emacs with @code{select-window} also
471 makes that window selected within its frame. @xref{Selecting Windows}. 470 makes that window selected within its frame. @xref{Selecting Windows}.
480 However, you can also create a frame with no minibuffer. Such a frame 479 However, you can also create a frame with no minibuffer. Such a frame
481 must use the minibuffer window of some other frame. When you create the 480 must use the minibuffer window of some other frame. When you create the
482 frame, you can specify explicitly the frame on which to find the 481 frame, you can specify explicitly the frame on which to find the
483 minibuffer to use. If you don't, then the minibuffer is found in the 482 minibuffer to use. If you don't, then the minibuffer is found in the
484 frame which is the value of the variable 483 frame which is the value of the variable
485 @code{default-minibuffer-frame}. Its value should be a frame which does 484 @code{default-minibuffer-frame}. Its value should be a frame that does
486 have a minibuffer. 485 have a minibuffer.
487 486
488 If you use a minibuffer-only frame, you might want that frame to raise 487 If you use a minibuffer-only frame, you might want that frame to raise
489 when you enter the minibuffer. If so, set the variable 488 when you enter the minibuffer. If so, set the variable
490 @code{minibuffer-auto-raise} to @code{t}. @xref{Raising and Lowering}. 489 @code{minibuffer-auto-raise} to @code{t}. @xref{Raising and Lowering}.
532 Don't call it for any other reason. 531 Don't call it for any other reason.
533 @end deffn 532 @end deffn
534 533
535 @defun redirect-frame-focus frame focus-frame 534 @defun redirect-frame-focus frame focus-frame
536 This function redirects focus from @var{frame} to @var{focus-frame}. 535 This function redirects focus from @var{frame} to @var{focus-frame}.
537 This means that @var{focus-frame} will receive subsequent keystrokes and 536 This means that @var{focus-frame} will receive subsequent keystrokes
538 intended for @var{frame}. After such an event, the value of 537 intended for @var{frame}. After such an event, the value of
539 @code{last-event-frame} will be @var{focus-frame}. Also, switch-frame 538 @code{last-event-frame} will be @var{focus-frame}. Also, switch-frame
540 events specifying @var{frame} will instead select @var{focus-frame}. 539 events specifying @var{frame} will instead select @var{focus-frame}.
541 540
542 If @var{focus-frame} is @code{nil}, that cancels any existing 541 If @var{focus-frame} is @code{nil}, that cancels any existing
545 544
546 One use of focus redirection is for frames that don't have minibuffers. 545 One use of focus redirection is for frames that don't have minibuffers.
547 These frames use minibuffers on other frames. Activating a minibuffer 546 These frames use minibuffers on other frames. Activating a minibuffer
548 on another frame redirects focus to that frame. This puts the focus on 547 on another frame redirects focus to that frame. This puts the focus on
549 the minibuffer's frame, where it belongs, even though the mouse remains 548 the minibuffer's frame, where it belongs, even though the mouse remains
550 in the frame which activated the minibuffer. 549 in the frame that activated the minibuffer.
551 550
552 Selecting a frame can also change focus redirections. Selecting frame 551 Selecting a frame can also change focus redirections. Selecting frame
553 @code{bar}, when @code{foo} had been selected, changes any redirections 552 @code{bar}, when @code{foo} had been selected, changes any redirections
554 pointing to @code{foo} so that they point to @code{bar} instead. This 553 pointing to @code{foo} so that they point to @code{bar} instead. This
555 allows focus redirection to work properly when the user switches from 554 allows focus redirection to work properly when the user switches from
571 @cindex frame visibility 570 @cindex frame visibility
572 571
573 A frame may be @dfn{visible}, @dfn{invisible}, or @dfn{iconified}. If 572 A frame may be @dfn{visible}, @dfn{invisible}, or @dfn{iconified}. If
574 it is visible, you can see its contents. If it is iconified, the 573 it is visible, you can see its contents. If it is iconified, the
575 frame's contents do not appear on the screen, but an icon does. If the 574 frame's contents do not appear on the screen, but an icon does. If the
576 frame is invisible, it doesn't show in the screen, not even as an icon. 575 frame is invisible, it doesn't show on the screen, not even as an icon.
577 576
578 @deffn Command make-frame-visible &optional frame 577 @deffn Command make-frame-visible &optional frame
579 This function makes frame @var{frame} visible. If you omit @var{frame}, 578 This function makes frame @var{frame} visible. If you omit @var{frame},
580 it makes the selected frame visible. 579 it makes the selected frame visible.
581 @end deffn 580 @end deffn
644 643
645 A @dfn{frame configuration} records the current arrangement of frames, 644 A @dfn{frame configuration} records the current arrangement of frames,
646 all their properties, and the window configuration of each one. 645 all their properties, and the window configuration of each one.
647 646
648 @defun current-frame-configuration 647 @defun current-frame-configuration
649 This function returns a frame configuration list which describes 648 This function returns a frame configuration list that describes
650 the current arrangement of frames and their contents. 649 the current arrangement of frames and their contents.
651 @end defun 650 @end defun
652 651
653 @defun set-frame-configuration configuration 652 @defun set-frame-configuration configuration
654 This function restores the state of frames described in 653 This function restores the state of frames described in
658 @node Mouse Tracking 657 @node Mouse Tracking
659 @section Mouse Tracking 658 @section Mouse Tracking
660 @cindex mouse tracking 659 @cindex mouse tracking
661 @cindex tracking the mouse 660 @cindex tracking the mouse
662 661
663 Sometimes it is useful to @dfn{track} the mouse, which means, to display 662 Sometimes it is useful to @dfn{track} the mouse, which means to display
664 something to indicate where the mouse is and move the indicator as the 663 something to indicate where the mouse is and move the indicator as the
665 mouse moves. For efficient mouse tracking, you need a way to wait until 664 mouse moves. For efficient mouse tracking, you need a way to wait until
666 the mouse actually moves. 665 the mouse actually moves.
667 666
668 The convenient way to track the mouse is to ask for events to represent 667 The convenient way to track the mouse is to ask for events to represent
909 independently. The usual values of @var{type} are @code{PRIMARY} and 908 independently. The usual values of @var{type} are @code{PRIMARY} and
910 @code{SECONDARY}; these are symbols with upper-case names, in accord 909 @code{SECONDARY}; these are symbols with upper-case names, in accord
911 with X Window System conventions. The default is @code{PRIMARY}. 910 with X Window System conventions. The default is @code{PRIMARY}.
912 @end defun 911 @end defun
913 912
914 @defun x-get-selection type data-type 913 @defun x-get-selection &optional type data-type
915 This function accesses selections set up by Emacs or by other X 914 This function accesses selections set up by Emacs or by other X
916 clients. It takes two optional arguments, @var{type} and 915 clients. It takes two optional arguments, @var{type} and
917 @var{data-type}. The default for @var{type}, the selection type, is 916 @var{data-type}. The default for @var{type}, the selection type, is
918 @code{PRIMARY}. 917 @code{PRIMARY}.
919 918
1002 @end defun 1001 @end defun
1003 1002
1004 @node Resources 1003 @node Resources
1005 @section X Resources 1004 @section X Resources
1006 1005
1007 @defun x-get-resource attribute &optional name class 1006 @defun x-get-resource attribute &optional component subclass
1008 The function @code{x-get-resource} retrieves a resource value from the X 1007 The function @code{x-get-resource} retrieves a resource value from the X
1009 Windows defaults database. 1008 Windows defaults database.
1010 1009
1011 Resources are indexed by a combination of a @dfn{key} and a @dfn{class}. 1010 Resources are indexed by a combination of a @dfn{key} and a @dfn{class}.
1012 This function searches using a key of the form 1011 This function searches using a key of the form
1013 @samp{@var{instance}.@var{attribute}}, using the name under which Emacs 1012 @samp{@var{instance}.@var{attribute}} (where @var{instance} is the name
1014 was invoked as @var{instance}, and using @samp{Emacs} as the class. 1013 under which Emacs was invoked), and using @samp{Emacs} as the class.
1015 1014
1016 The optional arguments @var{component} and @var{subclass} add to the key 1015 The optional arguments @var{component} and @var{subclass} add to the key
1017 and the class, respectively. You must specify both of them or neither. 1016 and the class, respectively. You must specify both of them or neither.
1018 If you specify them, the key is 1017 If you specify them, the key is
1019 @samp{@var{instance}.@var{component}.@var{attribute}}, and the class is 1018 @samp{@var{instance}.@var{component}.@var{attribute}}, and the class is