diff options
| author | Richard M. Stallman | 2005-03-26 02:00:32 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-03-26 02:00:32 +0000 |
| commit | 10214524f12f7ecf43fa4ce71b3f61bdab89537c (patch) | |
| tree | 58032f9ee1b0fdaf8b57f43df271bf7640917b3e | |
| parent | 8613ded15317b86f86d2afea3b938454a176a3b5 (diff) | |
| download | emacs-10214524f12f7ecf43fa4ce71b3f61bdab89537c.tar.gz emacs-10214524f12f7ecf43fa4ce71b3f61bdab89537c.zip | |
(X Resources): GTK options documented too.
(Resources): Clarify meaning of program name.
(Table of Resources): Add visualClass.
(GTK resources): Rewrite.
(GTK widget names, GTK Names in Emacs, GTK styles): Cleanups.
| -rw-r--r-- | man/xresources.texi | 291 |
1 files changed, 157 insertions, 134 deletions
diff --git a/man/xresources.texi b/man/xresources.texi index b1b7d230660..cd11e5ccd9a 100644 --- a/man/xresources.texi +++ b/man/xresources.texi | |||
| @@ -7,10 +7,14 @@ | |||
| 7 | You can customize some X-related aspects of Emacs behavior using X | 7 | You can customize some X-related aspects of Emacs behavior using X |
| 8 | resources, as is usual for programs that use X. On MS-Windows, you | 8 | resources, as is usual for programs that use X. On MS-Windows, you |
| 9 | can customize some of the same aspects using the system registry. | 9 | can customize some of the same aspects using the system registry. |
| 10 | @xref{MS-Windows Registry}. X resources are the only way to customize | 10 | @xref{MS-Windows Registry}. |
| 11 | tooltip windows and LessTif menus, since the libraries that implement | 11 | |
| 12 | them don't provide for customization through Emacs. This appendix | 12 | When Emacs is built using an `X toolkit', such as Lucid or LessTif, |
| 13 | describes the X resources that Emacs recognizes and how to use them. | 13 | you need to use X resources to customize the appearance of the |
| 14 | widgets, including the menu-bar, scroll-bar, and dialog boxes. This | ||
| 15 | is because the libraries that implement these don't provide for | ||
| 16 | customization through Emacs. GTK+ widgets use a separate system of | ||
| 17 | `GTK resources', which we will also describe. | ||
| 14 | 18 | ||
| 15 | @menu | 19 | @menu |
| 16 | * Resources:: Using X resources with Emacs (in general). | 20 | * Resources:: Using X resources with Emacs (in general). |
| @@ -58,6 +62,11 @@ of the external border. Both of these resources are part of the | |||
| 58 | @samp{BorderWidth} class. Case distinctions are significant in these | 62 | @samp{BorderWidth} class. Case distinctions are significant in these |
| 59 | names. | 63 | names. |
| 60 | 64 | ||
| 65 | Every resource definition is associated with a specific program | ||
| 66 | name---the name of the executable file that you ran. For Emacs, that | ||
| 67 | is normally @samp{emacs}. To specify a definition for all instances | ||
| 68 | of Emacs, regardless of their names, use @samp{Emacs}. | ||
| 69 | |||
| 61 | In @file{~/.Xdefaults}, you can specify a value for a single resource | 70 | In @file{~/.Xdefaults}, you can specify a value for a single resource |
| 62 | on one line, like this: | 71 | on one line, like this: |
| 63 | 72 | ||
| @@ -86,11 +95,8 @@ emacs.borderWidth: 4 | |||
| 86 | 95 | ||
| 87 | The order in which the lines appear in the file does not matter. | 96 | The order in which the lines appear in the file does not matter. |
| 88 | Also, command-line options always override the X resources file. | 97 | Also, command-line options always override the X resources file. |
| 89 | 98 | Here is a list of X command-line options and their corresponding | |
| 90 | The string @samp{emacs} in the examples above is also a resource | 99 | resource names. |
| 91 | name. It actually represents the name of the executable file that you | ||
| 92 | invoke to run Emacs. If Emacs is installed under a different name, it | ||
| 93 | looks for resources under that name instead of @samp{emacs}. | ||
| 94 | 100 | ||
| 95 | @table @samp | 101 | @table @samp |
| 96 | @item -name @var{name} | 102 | @item -name @var{name} |
| @@ -272,6 +278,17 @@ especially slow X client/server links. | |||
| 272 | @item @code{verticalScrollBars} (class @code{ScrollBars}) | 278 | @item @code{verticalScrollBars} (class @code{ScrollBars}) |
| 273 | Give frames scroll bars if @samp{on}; don't have scroll bars if | 279 | Give frames scroll bars if @samp{on}; don't have scroll bars if |
| 274 | @samp{off}. | 280 | @samp{off}. |
| 281 | |||
| 282 | @item @code{visualClass} (class @code{VisualClass}) | ||
| 283 | Specify the ``visual'' that X should use. This tells X how to handle | ||
| 284 | colors. | ||
| 285 | |||
| 286 | The value should start with one of @samp{TrueColor}, | ||
| 287 | @samp{PseudoColor}, @samp{DirectColor}, @samp{StaticColor}, | ||
| 288 | @samp{GrayScale}, and @samp{StaticGray}, followed by | ||
| 289 | @samp{-@var{depth}}, where @var{depth} is the number of color planes. | ||
| 290 | Most terminals only allow a few ``visuals,'' and the @samp{dpyinfo} | ||
| 291 | program outputs information saying which ones. | ||
| 275 | @end table | 292 | @end table |
| 276 | 293 | ||
| 277 | @node Face Resources | 294 | @node Face Resources |
| @@ -552,31 +569,32 @@ The color for the border shadow, on the top and the left. | |||
| 552 | @cindex @file{~/.gtkrc-2.0} file | 569 | @cindex @file{~/.gtkrc-2.0} file |
| 553 | @cindex @file{~/.emacs.d/gtkrc} file | 570 | @cindex @file{~/.emacs.d/gtkrc} file |
| 554 | 571 | ||
| 555 | If the Emacs installed at your site was built to use the GTK widget set, | 572 | If Emacs was built to use the GTK widget set, then the menu bar, |
| 556 | then the menu bar, scroll bar and the dialogs can be customized with | 573 | scroll bar and the dialogs are customized with the standard GTK |
| 557 | the standard GTK @file{~/.gtkrc-2.0} file or with the Emacs specific | 574 | customization file, @file{~/.gtkrc-2.0}, or with the Emacs specific |
| 558 | @file{~/.emacs.d/gtkrc} file; note that these files are only for | 575 | file @file{~/.emacs.d/gtkrc}. We recommend that you use |
| 559 | customizing specific GTK widget features. To customize Emacs font, | 576 | @file{~/.emacs.d/gtkrc} for customizations, since @file{~/.gtkrc-2.0} |
| 560 | background, faces etc., use the normal X resources, see @ref{Resources}. | 577 | seems to be ignored when running GConf with GNOME. These files apply |
| 578 | only to GTK widget features. To customize Emacs font, background, | ||
| 579 | faces, etc., use the normal X resources (@pxref{Resources}). | ||
| 561 | 580 | ||
| 562 | Some GTK themes override these mechanisms, which means that using | 581 | Some GTK themes override these mechanisms, which means that using |
| 563 | these mechanisms will not work to customize them. We recommend that | 582 | these mechanisms will not work to customize them. |
| 564 | you use @file{~/.emacs.d/gtkrc} for customizations, since | ||
| 565 | @file{~/.gtkrc-2.0} seems to be ignored when running GConf with GNOME. | ||
| 566 | 583 | ||
| 567 | In these files you first defines a style and then how to apply that style | 584 | In these files you first define a style and say what it means; then |
| 568 | to widgets (@pxref{GTK widget names}). Here is an example of how to | 585 | you specify to apply the style to various widget types (@pxref{GTK |
| 569 | change the font for Emacs menus: | 586 | widget names}). Here is an example of how to change the font for |
| 587 | Emacs menus: | ||
| 570 | 588 | ||
| 571 | @smallexample | 589 | @smallexample |
| 572 | # This is a comment. | 590 | # @r{Define the style @samp{metafont}.} |
| 573 | style "menufont" | 591 | style "menufont" |
| 574 | @{ | 592 | @{ |
| 575 | font_name = "helvetica bold 14" # This is a Pango font name | 593 | font_name = "helvetica bold 14" # This is a Pango font name |
| 576 | @} | 594 | @} |
| 577 | 595 | ||
| 596 | # @r{Specify that widget type @samp{*emacs-menuitem*} uses @samp{metafont}.} | ||
| 578 | widget "*emacs-menuitem*" style "menufont" | 597 | widget "*emacs-menuitem*" style "menufont" |
| 579 | |||
| 580 | @end smallexample | 598 | @end smallexample |
| 581 | 599 | ||
| 582 | Here is a more elaborate example, showing how to change the parts of | 600 | Here is a more elaborate example, showing how to change the parts of |
| @@ -585,72 +603,74 @@ the scroll bar: | |||
| 585 | @smallexample | 603 | @smallexample |
| 586 | style "scroll" | 604 | style "scroll" |
| 587 | @{ | 605 | @{ |
| 588 | fg[NORMAL] = "red"@ @ @ @ @ # The arrow color. | 606 | fg[NORMAL] = "red"@ @ @ @ @ # @r{The arrow color.} |
| 589 | bg[NORMAL] = "yellow"@ @ # The thumb and background around the arrow. | 607 | bg[NORMAL] = "yellow"@ @ # @r{The thumb and background around the arrow.} |
| 590 | bg[ACTIVE] = "blue"@ @ @ @ # The trough color. | 608 | bg[ACTIVE] = "blue"@ @ @ @ # @r{The trough color.} |
| 591 | bg[PRELIGHT] = "white"@ # The thumb color when the mouse is over it. | 609 | bg[PRELIGHT] = "white"@ # @r{The thumb color when the mouse is over it.} |
| 592 | @} | 610 | @} |
| 593 | 611 | ||
| 594 | widget "*verticalScrollBar*" style "scroll" | 612 | widget "*verticalScrollBar*" style "scroll" |
| 595 | @end smallexample | 613 | @end smallexample |
| 596 | 614 | ||
| 597 | There are some things you can set without using any style or widget name, | 615 | There are also parameters that affect GTK as a whole. For example, the property |
| 598 | which affect GTK as a whole. Most of these are poorly documented, but can | 616 | @c @code{gtk-font-name} sets the default font for GTK. You must use |
| 599 | be found in the `Properties' section of the documentation page for | 617 | @c Pango font names (@pxref{GTK styles}). A GTK resources file that |
| 600 | @code{GtkSetting}, in the GTK document references below. | 618 | @c just sets a default font looks like this: |
| 601 | |||
| 602 | One property of interest is @code{gtk-font-name} which sets the default | ||
| 603 | font for GTK; you must use Pango font names (@pxref{GTK styles}). A | ||
| 604 | @file{~/.gtkrc-2.0} file that just sets a default font looks like this: | ||
| 605 | 619 | ||
| 606 | @smallexample | 620 | @smallexample |
| 607 | gtk-font-name = "courier 12" | 621 | gtk-font-name = "courier 12" |
| 608 | @end smallexample | 622 | @end smallexample |
| 609 | 623 | ||
| 610 | 624 | The GTK resources file is fully described in the GTK API document. | |
| 611 | If GTK at your site is installed under @var{prefix}, | 625 | This can be found in |
| 612 | the resource file syntax is fully described in the GTK API | 626 | @file{@var{prefix}/share/gtk-doc/html/gtk/gtk-resource-files.html}, |
| 613 | document | 627 | where @file{prefix} is the directory in which the GTK libraries were |
| 614 | @file{@var{prefix}/share/gtk-doc/html/gtk/gtk-resource-files.html}. | 628 | installed (usually @file{/usr} or @file{/usr/local}). You can also |
| 615 | @var{prefix} is usually @file{/usr} or @file{/usr/local}. | 629 | find the document online, at |
| 616 | You can find the same document online at | ||
| 617 | @uref{http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html}. | 630 | @uref{http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html}. |
| 618 | 631 | ||
| 619 | |||
| 620 | @menu | 632 | @menu |
| 621 | * GTK widget names:: How widgets in GTK are named in general. | 633 | * GTK widget names:: How widgets in GTK are named in general. |
| 622 | * GTK names in Emacs:: GTK widget names in Emacs. | 634 | * GTK names in Emacs:: GTK widget names in Emacs. |
| 623 | * GTK styles:: What can be customized in a GTK widget. | 635 | * GTK styles:: What can be customized in a GTK widget. |
| 624 | @end menu | 636 | @end menu |
| 625 | 637 | ||
| 626 | |||
| 627 | @node GTK widget names | 638 | @node GTK widget names |
| 628 | @appendixsubsec GTK widget names | 639 | @appendixsubsec GTK widget names |
| 629 | @cindex GTK widget names | 640 | @cindex GTK widget names |
| 630 | 641 | ||
| 631 | Widgets are specified by widget class or by widget name. | 642 | A GTK widget is specified by its @dfn{widget class} and |
| 632 | The widget class is the type of the widget, for example @code{GtkMenuBar}. | 643 | @dfn{widget name}. The widget class is the type of the widget: for |
| 633 | The widget name is the name given to a specific widget within a program. | 644 | example, @code{GtkMenuBar}. The widget name is the name given to a |
| 634 | A widget always have a class but it is not mandatory to give a name to | 645 | specific widget. A widget always has a class, but need not have a |
| 635 | a widget. Absolute names are sequences of widget names or | 646 | name. |
| 636 | widget classes, corresponding to hierarchies of widgets embedded within | ||
| 637 | other widgets. For example, if a @code{GtkWindow} contains a @code{GtkVBox} | ||
| 638 | which in turn contains a @code{GtkMenuBar}, the absolute class name | ||
| 639 | is @code{GtkWindow.GtkVBox.GtkMenuBar}. | ||
| 640 | 647 | ||
| 641 | @noindent | 648 | @dfn{Absolute names} are sequences of widget names or widget |
| 642 | If the widgets are named ``top'', ``box'' and ``menubar'', the absolute | 649 | classes, corresponding to hierarchies of widgets embedded within |
| 643 | widget name is @code{top.box.menubar}, | 650 | other widgets. For example, if a @code{GtkWindow} named @code{top} |
| 651 | contains a @code{GtkVBox} named @code{box}, which in turn contains | ||
| 652 | a @code{GtkMenuBar} called @code{menubar}, the absolute class name | ||
| 653 | of the menu-bar widget is @code{GtkWindow.GtkVBox.GtkMenuBar}, and | ||
| 654 | its absolute widget name is @code{top.box.menubar}. | ||
| 644 | 655 | ||
| 645 | When assigning a style to a widget, you can use the absolute class | 656 | When assigning a style to a widget, you can use the absolute class |
| 646 | name or the absolute widget name. | 657 | name or the absolute widget name. |
| 647 | There are two commands: @code{widget_class} will assign a style to | 658 | |
| 648 | widgets, matching only against the absolute class name. | 659 | There are two commands to specify changes for widgets: |
| 649 | The command @code{widget} will match the absolute widget name, | 660 | |
| 650 | but if there is no name for a widget in the hierarchy, the class is matched. | 661 | @table @asis |
| 651 | These commands require the absolute name and the style name to be | 662 | @item @code{widget_class} |
| 652 | within double quotes. These commands are written at the top level in a | 663 | specifies a style for widgets based on the absolute class name. |
| 653 | @file{~/.gtkrc-2.0} file, like this: | 664 | |
| 665 | @item @code{widget} | ||
| 666 | specifies a style for widgets based on the absolute class name, | ||
| 667 | or just the class. | ||
| 668 | @end table | ||
| 669 | |||
| 670 | @noindent | ||
| 671 | You must soecify the class and the style in double-quotes, and put | ||
| 672 | these commands at the top level in a @file{~/.gtkrc-2.0} file, like | ||
| 673 | this: | ||
| 654 | 674 | ||
| 655 | @smallexample | 675 | @smallexample |
| 656 | style "menufont" | 676 | style "menufont" |
| @@ -662,18 +682,17 @@ widget "top.box.menubar" style "menufont" | |||
| 662 | widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "menufont" | 682 | widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "menufont" |
| 663 | @end smallexample | 683 | @end smallexample |
| 664 | 684 | ||
| 665 | 685 | Matching of absolute names uses shell wildcard syntax: @samp{*} | |
| 666 | Matching of absolute names is done with shell ``glob'' syntax, that is | 686 | matches zero or more characters and @samp{?} matches one character. |
| 667 | @samp{*} matches zero or more characters and @samp{?} matches one character. | 687 | This example assigns @code{base_style} to all widgets: |
| 668 | So the following would assign @code{base_style} to all widgets: | ||
| 669 | 688 | ||
| 670 | @smallexample | 689 | @smallexample |
| 671 | widget "*" style "base_style" | 690 | widget "*" style "base_style" |
| 672 | @end smallexample | 691 | @end smallexample |
| 673 | 692 | ||
| 674 | Given the absolute class name @code{GtkWindow.GtkVBox.GtkMenuBar} | 693 | Given the absolute class name @code{GtkWindow.GtkVBox.GtkMenuBar} |
| 675 | and the corresponding absolute widget name @code{top.box.menubar}, | 694 | and the corresponding absolute widget name @code{top.box.menubar}, all |
| 676 | the following all assign @code{my_style} to the menu bar: | 695 | these examples specify @code{my_style} for the menu bar: |
| 677 | 696 | ||
| 678 | @smallexample | 697 | @smallexample |
| 679 | widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style" | 698 | widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style" |
| @@ -685,17 +704,17 @@ widget "*menubar" style "my_style" | |||
| 685 | widget "*menu*" style "my_style" | 704 | widget "*menu*" style "my_style" |
| 686 | @end smallexample | 705 | @end smallexample |
| 687 | 706 | ||
| 688 | @node GTK names in Emacs | 707 | @node GTK Names in Emacs |
| 689 | @appendixsubsec GTK names in Emacs | 708 | @appendixsubsec GTK Widget Names in Emacs |
| 690 | @cindex GTK widget names | 709 | @cindex GTK widget names |
| 691 | @cindex GTK widget classes | 710 | @cindex GTK widget classes |
| 692 | 711 | ||
| 693 | In Emacs the top level widget for a frame is a @code{GtkWindow} that | 712 | In Emacs, the top level widget for a frame is a @code{GtkWindow} |
| 694 | contains a @code{GtkVBox}. The @code{GtkVBox} contains the | 713 | that contains a @code{GtkVBox}. The @code{GtkVBox} contains the |
| 695 | @code{GtkMenuBar} and a @code{GtkFixed} widget. | 714 | @code{GtkMenuBar} and a @code{GtkFixed} widget. The vertical scroll |
| 696 | The vertical scroll bars, @code{GtkVScrollbar}, | 715 | bars, @code{GtkVScrollbar}, are contained in the @code{GtkFixed} |
| 697 | are contained in the @code{GtkFixed} widget. | 716 | widget. The text you write in Emacs is drawn in the @code{GtkFixed} |
| 698 | The text you write in Emacs is drawn in the @code{GtkFixed} widget. | 717 | widget. |
| 699 | 718 | ||
| 700 | Dialogs in Emacs are @code{GtkDialog} widgets. The file dialog is a | 719 | Dialogs in Emacs are @code{GtkDialog} widgets. The file dialog is a |
| 701 | @code{GtkFileSelection} widget. | 720 | @code{GtkFileSelection} widget. |
| @@ -759,14 +778,14 @@ widget "*emacs-filedialog* style "my_file_style" | |||
| 759 | widget "*emacs-menuitem* style "my_menu_style" | 778 | widget "*emacs-menuitem* style "my_menu_style" |
| 760 | @end smallexample | 779 | @end smallexample |
| 761 | 780 | ||
| 762 | An alternative is to put customization into @file{~/.emacs.d/gtkrc}. | 781 | If you specify a customization in @file{~/.emacs.d/gtkrc}, then it |
| 763 | This file is only read by Emacs, so anything in @file{~/.emacs.d/gtkrc} | 782 | automatically applies only to Emacs, since other programs don't read |
| 764 | affects Emacs but leaves other applications unaffected. | 783 | that file. For example, the drop down menu in the file dialog can not |
| 765 | For example, the drop down menu in the file dialog can not | 784 | be customized by any absolute widget name, only by an absolute class |
| 766 | be customized by any absolute widget name, only by an absolute | 785 | name. This is so because the widgets in the drop down menu do not |
| 767 | class name. This is so because the widgets in the drop down menu does not | 786 | have names and the menu is not contained in the Emacs GtkWindow. To |
| 768 | have names and the menu is not contained in the Emacs GtkWindow. | 787 | have all menus in Emacs look the same, use this in |
| 769 | To have all menus in Emacs look the same, use this in @file{~/.emacs.d/gtkrc}: | 788 | @file{~/.emacs.d/gtkrc}: |
| 770 | 789 | ||
| 771 | @smallexample | 790 | @smallexample |
| 772 | widget_class "*Menu*" style "my_menu_style" | 791 | widget_class "*Menu*" style "my_menu_style" |
| @@ -777,16 +796,16 @@ widget_class "*Menu*" style "my_menu_style" | |||
| 777 | @cindex GTK styles | 796 | @cindex GTK styles |
| 778 | 797 | ||
| 779 | In a GTK style you specify the appearance widgets shall have. You | 798 | In a GTK style you specify the appearance widgets shall have. You |
| 780 | can specify foreground and background color, background pixmap and font. | 799 | can specify foreground and background color, background pixmap and |
| 781 | The edit widget (where you edit the text) in Emacs is a GTK widget, | 800 | font. The edit widget (where you edit the text) in Emacs is a GTK |
| 782 | but trying to specify a style for the edit widget will have no effect. | 801 | widget, but trying to specify a style for the edit widget will have no |
| 783 | This is so that Emacs compiled for GTK is compatible with Emacs compiled | 802 | effect. This is so that Emacs compiled for GTK is compatible with |
| 784 | for other X toolkits. The settings for foreground, background and font | 803 | Emacs compiled for other X toolkits. The settings for foreground, |
| 785 | for the edit widget is taken from the X resources; @pxref{Resources}. | 804 | background and font for the edit widget is taken from the X resources; |
| 786 | Here is an example of two style declarations, ``default'' and ``ruler'': | 805 | @pxref{Resources}. Here is an example of two style declarations, |
| 806 | @samp{default} and @samp{ruler}: | ||
| 787 | 807 | ||
| 788 | @smallexample | 808 | @smallexample |
| 789 | |||
| 790 | pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps" | 809 | pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps" |
| 791 | 810 | ||
| 792 | style "default" | 811 | style "default" |
| @@ -821,12 +840,13 @@ style "ruler" = "default" | |||
| 821 | 840 | ||
| 822 | @end smallexample | 841 | @end smallexample |
| 823 | 842 | ||
| 824 | The style ``ruler'' inherits from ``default''. This way you can build | 843 | The style @samp{ruler} inherits from @samp{default}. This way you can build |
| 825 | on existing styles. The syntax for fonts and colors is described below. | 844 | on existing styles. The syntax for fonts and colors is described below. |
| 826 | 845 | ||
| 827 | As this example shows, it is possible to specify several values | 846 | As this example shows, it is possible to specify several values for |
| 828 | for foreground and background depending on which state the widget has. | 847 | foreground and background depending on the widget's @dfn{state}. The |
| 829 | The possible states are | 848 | possible states are: |
| 849 | |||
| 830 | @table @code | 850 | @table @code |
| 831 | @item NORMAL | 851 | @item NORMAL |
| 832 | This is the default state for widgets. | 852 | This is the default state for widgets. |
| @@ -846,71 +866,73 @@ be selected text or items selected in a list. | |||
| 846 | There is no place in Emacs where this setting has any effect. | 866 | There is no place in Emacs where this setting has any effect. |
| 847 | @item INSENSITIVE | 867 | @item INSENSITIVE |
| 848 | This is the state for widgets that are visible, but they can not be | 868 | This is the state for widgets that are visible, but they can not be |
| 849 | manipulated like they normally can. For example, buttons that can't be | 869 | manipulated in the usual way---for example, buttons that can't be |
| 850 | pressed and menu items that can't be selected. | 870 | pressed, and disabled menu items. To display disabled menu items in |
| 851 | Text for menu items that are not available can be set to yellow with | 871 | yellow, use @code{fg[INSENSITIVE] = "yellow"}. |
| 852 | @code{fg[INSENSITIVE] = "yellow"}. | ||
| 853 | @end table | 872 | @end table |
| 854 | 873 | ||
| 855 | Here are the things that can go in a style declaration: | 874 | Here are the things that can go in a style declaration: |
| 856 | 875 | ||
| 857 | @table @code | 876 | @table @code |
| 858 | @item bg[@var{state}] = @var{color} | 877 | @item bg[@var{state}] = @var{color} |
| 859 | This is the background color widgets use. This background is not used for | 878 | This specifies the background color for the widget. Note that |
| 860 | editable text, use @code{base} for that. | 879 | editable text doesn't use @code{bg}; it uses @code{base} instead. |
| 861 | 880 | ||
| 862 | @item base[@var{state}] = @var{color} | 881 | @item base[@var{state}] = @var{color} |
| 863 | This is the background color for editable text. | 882 | This specifies the background color for editable text. In Emacs, this |
| 864 | In Emacs, this color is used for the background of the text fields in the | 883 | color is used for the background of the text fields in the file |
| 865 | file dialog. | 884 | dialog. |
| 866 | 885 | ||
| 867 | @item bg_pixmap[@var{state}] = "@var{pixmap}" | 886 | @item bg_pixmap[@var{state}] = "@var{pixmap}" |
| 868 | You can specify a pixmap to be used instead of the background color. | 887 | This specifies an image background (instead of a background color). |
| 869 | @var{pixmap} is a file name. GTK can use a number of file formats, | 888 | @var{pixmap} should be the image file name. GTK can use a number of |
| 870 | including XPM, XBM, GIF, JPEG and PNG. If you want a widget to use the same | 889 | image file formats, including XPM, XBM, GIF, JPEG and PNG. If you |
| 871 | pixmap as its parent, use @samp{<parent>}. If you don't want any | 890 | want a widget to use the same image as its parent, use |
| 872 | pixmap use @samp{<none>}. Using @samp{<none>} can be useful | 891 | @samp{<parent>}. If you don't want any image, use @samp{<none>}. |
| 873 | if your style inherits a style that does specify a pixmap. | 892 | @samp{<none>} is the way to cancel a background image inherited from a |
| 874 | 893 | parent style. | |
| 875 | GTK looks for the pixmap in directories specified in @code{pixmap_path}. | 894 | |
| 876 | It is not possible to refer to a file by its absolute path name. | 895 | You can't specify the file by its absolute file name. GTK looks for |
| 877 | @code{pixmap_path} is a colon-separated list of directories within double | 896 | the pixmap file in directories specified in @code{pixmap_path}. |
| 878 | quotes, specified at the top level in a @file{gtkrc} file (i.e. not inside | 897 | @code{pixmap_path} is a colon-separated list of directories within |
| 879 | a style definition; see example above): | 898 | double quotes, specified at the top level in a @file{gtkrc} file |
| 899 | (i.e. not inside a style definition; see example above): | ||
| 880 | 900 | ||
| 881 | @smallexample | 901 | @smallexample |
| 882 | pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps" | 902 | pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps" |
| 883 | @end smallexample | 903 | @end smallexample |
| 884 | 904 | ||
| 885 | @item fg[@var{state}] = @var{color} | 905 | @item fg[@var{state}] = @var{color} |
| 886 | This is the foreground color widgets use. This is the color | 906 | This specifies the foreground color for widgets to use. It is the |
| 887 | of text in menus and buttons. It is also the color for the arrows in the | 907 | color of text in menus and buttons, and the color for the arrows in |
| 888 | scroll bar. For editable text, use @code{text}. | 908 | the scroll bar. For editable text, use @code{text}. |
| 889 | 909 | ||
| 890 | @item text[@var{state}] = @var{color} | 910 | @item text[@var{state}] = @var{color} |
| 891 | This is the color for editable text. In Emacs, this color is used for the | 911 | This is the color for editable text. In Emacs, this color is used for the |
| 892 | text fields in the file dialog. | 912 | text fields in the file dialog. |
| 893 | 913 | ||
| 894 | @item font_name = "@var{font}" | 914 | @item font_name = "@var{font}" |
| 895 | This is the font a widget shall use. @var{font} is a Pango font name, | 915 | This specifies the the font for text in the widget. @var{font} is a |
| 896 | for example ``Sans Italic 10'', ``Helvetica Bold 12'', ``Courier 14'', | 916 | Pango font name, for example @samp{Sans Italic 10}, @samp{Helvetica |
| 897 | ``Times 18''. See below for exact syntax. The names are case insensitive. | 917 | Bold 12}, @samp{Courier 14}, @samp{Times 18}. See below for exact |
| 918 | syntax. The names are case insensitive. | ||
| 898 | @end table | 919 | @end table |
| 899 | 920 | ||
| 900 | Colors are specified in three ways, a name, a hexadecimal form or | 921 | There are three ways to specify a color: by name, in hexadecimal |
| 901 | an RGB triplet. | 922 | form, and with an RGB triplet. |
| 902 | 923 | ||
| 903 | @noindent | 924 | @noindent |
| 904 | A color name is written within double quotes, for example @code{"red"}. | 925 | A color name is written within double quotes, for example @code{"red"}. |
| 905 | 926 | ||
| 906 | @noindent | 927 | @noindent |
| 907 | A hexadecimal form is written within double quotes. There are four forms, | 928 | Hexadecimal form is the same as in X: |
| 908 | @code{#rrrrggggbbbb}, @code{#rrrgggbbb}, | 929 | @code{#@var{rrrr}@var{gggg}@var{bbbb}}, where all three color specs |
| 909 | @code{#rrggbb}, or @code{#rgb}. In each of these r, g and b are hex digits. | 930 | must have the same number of hex digits (1, 2, 3 or 4). |
| 910 | 931 | ||
| 911 | @noindent | 932 | @noindent |
| 912 | An RGB triplet looks like @code{@{ r, g, b @}}, where r, g and b are either | 933 | An RGB triplet looks like @code{@{ @var{r}, @var{g}, @var{b} @}}, |
| 913 | integers in the range 0-65535 or floats in the range 0.0-1.0. | 934 | where @var{r}, @var{g} and @var{b} are either integers in the range |
| 935 | 0-65535 or floats in the range 0.0-1.0. | ||
| 914 | 936 | ||
| 915 | Pango font names have the form ``@var{family-list} @var{style-options} | 937 | Pango font names have the form ``@var{family-list} @var{style-options} |
| 916 | @var{size}''. | 938 | @var{size}''. |
| @@ -935,8 +957,9 @@ these is @code{normal}. | |||
| 935 | 957 | ||
| 936 | @noindent | 958 | @noindent |
| 937 | A `style' corresponds to the fourth part of an X font name. In X font | 959 | A `style' corresponds to the fourth part of an X font name. In X font |
| 938 | names it is the character ``r'', ``i'' or ``o''; in Pango font names the | 960 | names it is the character @samp{r}, @samp{i} or @samp{o}; in Pango |
| 939 | corresponding values are @code{normal}, @code{italic}, or @code{oblique}. | 961 | font names the corresponding values are @code{normal}, @code{italic}, |
| 962 | or @code{oblique}. | ||
| 940 | 963 | ||
| 941 | @noindent | 964 | @noindent |
| 942 | A `variant' is either @code{normal} or @code{small-caps}. | 965 | A `variant' is either @code{normal} or @code{small-caps}. |