1 |
@c This is part of the Emacs manual. |
@c This is part of the Emacs manual. |
2 |
@c Copyright (C) 1987,93,94,95,1997,2001 Free Software Foundation, Inc. |
@c Copyright (C) 1987,93,94,95,1997,2001,03 Free Software Foundation, Inc. |
3 |
@c See file emacs.texi for copying conditions. |
@c See file emacs.texi for copying conditions. |
4 |
@node X Resources, Antinews, Command Arguments, Top |
@node X Resources, Antinews, Command Arguments, Top |
5 |
@appendix X Options and Resources |
@appendix X Options and Resources |
6 |
|
|
7 |
You can customize some X-related aspects of Emacs behavior using X |
You can customize some X-related aspects of Emacs behavior using X |
8 |
resources, as is usual for programs that use X. X resources are the |
resources, as is usual for programs that use X. On MS-Windows, you |
9 |
only way to customize tooltip windows and LessTif menus, since the |
can customize some of the same aspects using the system registry. |
10 |
libraries that implement them don't provide for customization through |
@xref{MS-Windows Registry}. X resources are the only way to customize |
11 |
Emacs. This appendix describes the X resources that Emacs recognizes |
tooltip windows and LessTif menus, since the libraries that implement |
12 |
and how to use them. |
them don't provide for customization through Emacs. This appendix |
13 |
|
describes the X resources that Emacs recognizes and how to use them. |
14 |
|
|
15 |
@menu |
@menu |
16 |
* Resources:: Using X resources with Emacs (in general). |
* Resources:: Using X resources with Emacs (in general). |
18 |
* Face Resources:: X resources for customizing faces. |
* Face Resources:: X resources for customizing faces. |
19 |
* Lucid Resources:: X resources for Lucid menus. |
* Lucid Resources:: X resources for Lucid menus. |
20 |
* LessTif Resources:: X resources for LessTif and Motif menus. |
* LessTif Resources:: X resources for LessTif and Motif menus. |
21 |
|
* GTK resources:: Resources for GTK widgets. |
22 |
@end menu |
@end menu |
23 |
|
|
24 |
@node Resources |
@node Resources |
25 |
@appendixsec X Resources |
@appendixsec X Resources |
26 |
@cindex resources |
@cindex resources |
27 |
|
@cindex X resources |
28 |
|
@cindex @file{~/.Xdefaults} file |
29 |
|
@cindex @file{~/.Xresources} file |
30 |
|
|
|
@cindex X resources, @file{~/.Xdefaults} file |
|
31 |
Programs running under the X Window System organize their user |
Programs running under the X Window System organize their user |
32 |
options under a hierarchy of classes and resources. You can specify |
options under a hierarchy of classes and resources. You can specify |
33 |
default values for these options in your X resources file, usually |
default values for these options in your X resources file, usually |
34 |
named @file{~/.Xdefaults}. If changes in @file{~/.Xdefaults} do not |
named @file{~/.Xdefaults} or @file{~/.Xresources}. |
35 |
|
If changes in @file{~/.Xdefaults} do not |
36 |
take effect, it is because your X server stores its own list of |
take effect, it is because your X server stores its own list of |
37 |
resources; to update them, use the shell command @command{xrdb}---for |
resources; to update them, use the shell command @command{xrdb}---for |
38 |
instance, @samp{xrdb ~/.Xdefaults}. |
instance, @samp{xrdb ~/.Xdefaults}. |
42 |
(optionally even for all programs). |
(optionally even for all programs). |
43 |
|
|
44 |
@cindex Registry (MS-Windows) |
@cindex Registry (MS-Windows) |
|
@cindex @file{.Xdefaults} file, and MS-Windows |
|
45 |
MS-Windows systems don't support @file{~/.Xdefaults} files, but |
MS-Windows systems don't support @file{~/.Xdefaults} files, but |
46 |
Emacs compiled for Windows looks for X resources in the Windows |
Emacs compiled for Windows looks for X resources in the Windows |
47 |
Registry, under the key @samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs} |
Registry, under the key @samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs} |
205 |
@samp{off}. @xref{Lucid Resources}, and @ref{LessTif Resources}, for |
@samp{off}. @xref{Lucid Resources}, and @ref{LessTif Resources}, for |
206 |
how to control the appearance of the menu bar if you have one. |
how to control the appearance of the menu bar if you have one. |
207 |
|
|
|
@item @code{toolBar} (class @code{ToolBar}) |
|
|
Number of lines to reserve for the tool bar. A zero value suppresses |
|
|
the tool bar. If the value is non-zero and |
|
|
@code{auto-resize-tool-bars} is non-@code{nil}, the tool bar's size |
|
|
will be changed automatically so that all tool bar items are visible. |
|
|
|
|
208 |
@item @code{minibuffer} (class @code{Minibuffer}) |
@item @code{minibuffer} (class @code{Minibuffer}) |
209 |
If @samp{none}, don't make a minibuffer in this frame. |
If @samp{none}, don't make a minibuffer in this frame. |
210 |
It will use a separate minibuffer frame instead. |
It will use a separate minibuffer frame instead. |
216 |
@item @code{pointerColor} (class @code{Foreground}) |
@item @code{pointerColor} (class @code{Foreground}) |
217 |
Color of the mouse cursor. |
Color of the mouse cursor. |
218 |
|
|
|
@ignore |
|
219 |
@item @code{privateColormap} (class @code{PrivateColormap}) |
@item @code{privateColormap} (class @code{PrivateColormap}) |
220 |
If @samp{on}, use a private color map, in the case where the ``default |
If @samp{on}, use a private color map, in the case where the ``default |
221 |
visual'' of class PseudoColor and Emacs is using it. |
visual'' of class PseudoColor and Emacs is using it. |
|
@end ignore |
|
222 |
|
|
223 |
@item @code{reverseVideo} (class @code{ReverseVideo}) |
@item @code{reverseVideo} (class @code{ReverseVideo}) |
224 |
Switch foreground and background default colors if @samp{on}, use colors as |
Switch foreground and background default colors if @samp{on}, use colors as |
229 |
Gamma correction for colors, equivalent to the frame parameter |
Gamma correction for colors, equivalent to the frame parameter |
230 |
@code{screen-gamma}. |
@code{screen-gamma}. |
231 |
|
|
232 |
@item @code{selectionFont} (class @code{Font}) |
@item @code{selectionFont} (class @code{SelectionFont}) |
233 |
Font name for pop-up menu items, in non-toolkit versions of Emacs. (For |
Font name for pop-up menu items, in non-toolkit versions of Emacs. (For |
234 |
toolkit versions, see @ref{Lucid Resources}, also see @ref{LessTif |
toolkit versions, see @ref{Lucid Resources}, also see @ref{LessTif |
235 |
Resources}.) |
Resources}.) |
236 |
|
|
237 |
|
@item @code{selectionTimeout} (class @code{SelectionTimeout}) |
238 |
|
Number of milliseconds to wait for a selection reply. |
239 |
|
If the selection owner doesn't reply in this time, we give up. |
240 |
|
A value of 0 means wait as long as necessary. |
241 |
|
|
242 |
@item @code{synchronous} (class @code{Synchronous}) |
@item @code{synchronous} (class @code{Synchronous}) |
243 |
@cindex debugging X problems |
@cindex debugging X problems |
244 |
@cindex synchronous X mode |
@cindex synchronous X mode |
248 |
@item @code{title} (class @code{Title}) |
@item @code{title} (class @code{Title}) |
249 |
Name to display in the title bar of the initial Emacs frame. |
Name to display in the title bar of the initial Emacs frame. |
250 |
|
|
251 |
|
@item @code{toolBar} (class @code{ToolBar}) |
252 |
|
Number of lines to reserve for the tool bar. A zero value suppresses |
253 |
|
the tool bar. If the value is non-zero and |
254 |
|
@code{auto-resize-tool-bars} is non-@code{nil}, the tool bar's size |
255 |
|
will be changed automatically so that all tool bar items are visible. |
256 |
|
|
257 |
@item @code{verticalScrollBars} (class @code{ScrollBars}) |
@item @code{verticalScrollBars} (class @code{ScrollBars}) |
258 |
Give frames scroll bars if @samp{on}; don't have scroll bars if |
Give frames scroll bars if @samp{on}; don't have scroll bars if |
259 |
@samp{off}. |
@samp{off}. |
458 |
|
|
459 |
@noindent |
@noindent |
460 |
(This should be one long line.) |
(This should be one long line.) |
461 |
|
|
462 |
It's impossible to specify a resource for all the menu-bar items |
It's impossible to specify a resource for all the menu-bar items |
463 |
without also specifying it for the submenus as well. So if you want the |
without also specifying it for the submenus as well. So if you want the |
464 |
submenu items to look different from the menu bar itself, you must ask |
submenu items to look different from the menu bar itself, you must ask |
521 |
@item topShadowColor |
@item topShadowColor |
522 |
The color for the border shadow, on the top and the left. |
The color for the border shadow, on the top and the left. |
523 |
@end table |
@end table |
524 |
|
|
525 |
|
|
526 |
|
@node GTK resources |
527 |
|
@appendixsec GTK resources |
528 |
|
@cindex GTK resources and customization |
529 |
|
@cindex resource files for GTK |
530 |
|
@cindex @file{~/.gtkrc-2.0} file |
531 |
|
@cindex @file{~/.emacs.d/gtkrc} file |
532 |
|
|
533 |
|
If the Emacs installed at your site was built to use the GTK widget set, |
534 |
|
then the menu bar, scroll bar and the dialogs can be customized with |
535 |
|
the standard GTK @file{~/.gtkrc-2.0} file or with the Emacs specific |
536 |
|
@file{~/.emacs.d/gtkrc} file; note that these files are only for |
537 |
|
customizing specific GTK widget features. To customize Emacs font, |
538 |
|
background, faces etc., use the normal X resources, see @ref{Resources}. |
539 |
|
|
540 |
|
In these files you first defines a style and then how to apply that style |
541 |
|
to widgets (@pxref{GTK widget names}). Here is an example of how to |
542 |
|
change the font for Emacs menus: |
543 |
|
|
544 |
|
@smallexample |
545 |
|
# This is a comment. |
546 |
|
style "menufont" |
547 |
|
@{ |
548 |
|
font_name = "helvetica bold 14" # This is a Pango font name |
549 |
|
@} |
550 |
|
|
551 |
|
widget "*emacs-menuitem*" style "menufont" |
552 |
|
|
553 |
|
@end smallexample |
554 |
|
|
555 |
|
There are some things you can set without using any style or widget name, |
556 |
|
which affect GTK as a whole. Most of these are poorly documented, but can |
557 |
|
be found in the `Properties' section of the documentation page for |
558 |
|
@code{GtkSetting}, in the GTK document references below. |
559 |
|
|
560 |
|
One property of interest is @code{gtk-font-name} which sets the default |
561 |
|
font for GTK; you must use Pango font names (@pxref{GTK styles}). A |
562 |
|
@file{~/.gtkrc-2.0} file that just sets a default font looks like this: |
563 |
|
|
564 |
|
@smallexample |
565 |
|
gtk-font-name = "courier 12" |
566 |
|
@end smallexample |
567 |
|
|
568 |
|
|
569 |
|
If GTK at your site is installed under @var{prefix}, |
570 |
|
the resource file syntax is fully described in the GTK API |
571 |
|
document |
572 |
|
@file{@var{prefix}/share/gtk-doc/html/gtk/gtk-resource-files.html}. |
573 |
|
@var{prefix} is usually @file{/usr} or @file{/usr/local}. |
574 |
|
You can find the same document online at |
575 |
|
@uref{http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html}. |
576 |
|
|
577 |
|
|
578 |
|
@menu |
579 |
|
* GTK widget names:: How widgets in GTK are named in general. |
580 |
|
* GTK names in Emacs:: GTK widget names in Emacs. |
581 |
|
* GTK styles:: What can be customized in a GTK widget. |
582 |
|
@end menu |
583 |
|
|
584 |
|
|
585 |
|
@node GTK widget names |
586 |
|
@appendixsubsec GTK widget names |
587 |
|
@cindex GTK widget names |
588 |
|
|
589 |
|
Widgets are specified by widget class or by widget name. |
590 |
|
The widget class is the type of the widget, for example @code{GtkMenuBar}. |
591 |
|
The widget name is the name given to a specific widget within a program. |
592 |
|
A widget always have a class but it is not mandatory to give a name to |
593 |
|
a widget. Absolute names are sequences of widget names or |
594 |
|
widget classes, corresponding to hierarchies of widgets embedded within |
595 |
|
other widgets. For example, if a @code{GtkWindow} contains a @code{GtkVBox} |
596 |
|
which in turn contains a @code{GtkMenuBar}, the absolute class name |
597 |
|
is @code{GtkWindow.GtkVBox.GtkMenuBar}. |
598 |
|
|
599 |
|
@noindent |
600 |
|
If the widgets are named ``top'', ``box'' and ``menubar'', the absolute |
601 |
|
widget name is @code{top.box.menubar}, |
602 |
|
|
603 |
|
When assigning a style to a widget, you can use the absolute class |
604 |
|
name or the absolute widget name. |
605 |
|
There are two commands: @code{widget_class} will assign a style to |
606 |
|
widgets, matching only against the absolute class name. |
607 |
|
The command @code{widget} will match the absolute widget name, |
608 |
|
but if there is no name for a widget in the hierarchy, the class is matched. |
609 |
|
These commands require the absolute name and the style name to be |
610 |
|
within double quotes. These commands are written at the top level in a |
611 |
|
@file{~/.gtkrc-2.0} file, like this: |
612 |
|
|
613 |
|
@smallexample |
614 |
|
style "menufont" |
615 |
|
@{ |
616 |
|
font_name = "helvetica bold 14" |
617 |
|
@} |
618 |
|
|
619 |
|
widget "top.box.menubar" style "menufont" |
620 |
|
widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "menufont" |
621 |
|
@end smallexample |
622 |
|
|
623 |
|
|
624 |
|
Matching of absolute names is done with shell ``glob'' syntax, that is |
625 |
|
@samp{*} matches zero or more characters and @samp{?} matches one character. |
626 |
|
So the following would assign @code{base_style} to all widgets: |
627 |
|
|
628 |
|
@smallexample |
629 |
|
widget "*" style "base_style" |
630 |
|
@end smallexample |
631 |
|
|
632 |
|
Given the absolute class name @code{GtkWindow.GtkVBox.GtkMenuBar} |
633 |
|
and the corresponding absolute widget name @code{top.box.menubar}, |
634 |
|
the following all assign @code{my_style} to the menu bar: |
635 |
|
|
636 |
|
@smallexample |
637 |
|
widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style" |
638 |
|
widget_class "GtkWindow.*.GtkMenuBar" style "my_style" |
639 |
|
widget_class "*GtkMenuBar" style "my_style" |
640 |
|
widget "top.box.menubar" style "my_style" |
641 |
|
widget "*box*menubar" style "my_style" |
642 |
|
widget "*menubar" style "my_style" |
643 |
|
widget "*menu*" style "my_style" |
644 |
|
@end smallexample |
645 |
|
|
646 |
|
@node GTK names in Emacs |
647 |
|
@appendixsubsec GTK names in Emacs |
648 |
|
@cindex GTK widget names |
649 |
|
@cindex GTK widget classes |
650 |
|
|
651 |
|
In Emacs the top level widget for a frame is a @code{GtkWindow} that |
652 |
|
contains a @code{GtkVBox}. The @code{GtkVBox} contains the |
653 |
|
@code{GtkMenuBar} and a @code{GtkFixed} widget. |
654 |
|
The vertical scroll bars, @code{GtkVScrollbar}, |
655 |
|
are contained in the @code{GtkFixed} widget. |
656 |
|
The text you write in Emacs is drawn in the @code{GtkFixed} widget. |
657 |
|
|
658 |
|
Dialogs in Emacs are @code{GtkDialog} widgets. The file dialog is a |
659 |
|
@code{GtkFileSelection} widget. |
660 |
|
|
661 |
|
@noindent |
662 |
|
To set a style for the menu bar using the absolute class name, use: |
663 |
|
|
664 |
|
@smallexample |
665 |
|
widget_class "GtkWindow.GtkVBox.GtkMenuBar" style "my_style" |
666 |
|
@end smallexample |
667 |
|
|
668 |
|
@noindent |
669 |
|
For the scroll bar, the absolute class name is: |
670 |
|
|
671 |
|
@smallexample |
672 |
|
widget_class |
673 |
|
"GtkWindow.GtkVBox.GtkFixed.GtkVScrollbar" |
674 |
|
style "my_style" |
675 |
|
@end smallexample |
676 |
|
|
677 |
|
@noindent |
678 |
|
The names for the emacs widgets, and their classes, are: |
679 |
|
|
680 |
|
@multitable {@code{verticalScrollbar plus}} {@code{GtkFileSelection} and some} |
681 |
|
@item @code{emacs-filedialog} |
682 |
|
@tab @code{GtkFileSelection} |
683 |
|
@item @code{emacs-dialog} |
684 |
|
@tab @code{GtkDialog} |
685 |
|
@item @code{Emacs} |
686 |
|
@tab @code{GtkWindow} |
687 |
|
@item @code{pane} |
688 |
|
@tab @code{GtkVHbox} |
689 |
|
@item @code{emacs} |
690 |
|
@tab @code{GtkFixed} |
691 |
|
@item @code{verticalScrollbar} |
692 |
|
@tab @code{GtkVScrollbar} |
693 |
|
@item @code{emacs-toolbar} |
694 |
|
@tab @code{GtkToolbar} |
695 |
|
@item @code{menubar} |
696 |
|
@tab @code{GtkMenuBar} |
697 |
|
@item @code{emacs-menuitem} |
698 |
|
@tab anything in menus |
699 |
|
@end multitable |
700 |
|
|
701 |
|
@noindent |
702 |
|
Thus, for Emacs you can write the two examples above as: |
703 |
|
|
704 |
|
@smallexample |
705 |
|
widget "Emacs.pane.menubar" style "my_style" |
706 |
|
widget "Emacs.pane.emacs.verticalScrollbar" style "my_style" |
707 |
|
@end smallexample |
708 |
|
|
709 |
|
GTK absolute names are quite strange when it comes to menus |
710 |
|
and dialogs. The names do not start with @samp{Emacs}, as they are |
711 |
|
free-standing windows and not contained (in the GTK sense) by the |
712 |
|
Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this: |
713 |
|
|
714 |
|
@smallexample |
715 |
|
widget "*emacs-dialog*" style "my_dialog_style" |
716 |
|
widget "*emacs-filedialog* style "my_file_style" |
717 |
|
widget "*emacs-menuitem* style "my_menu_style" |
718 |
|
@end smallexample |
719 |
|
|
720 |
|
An alternative is to put customization into @file{~/.emacs.d/gtkrc}. |
721 |
|
This file is only read by Emacs, so anything in @file{~/.emacs.d/gtkrc} |
722 |
|
affects Emacs but leaves other applications unaffected. |
723 |
|
For example, the drop down menu in the file dialog can not |
724 |
|
be customized by any absolute widget name, only by an absolute |
725 |
|
class name. This is so because the widgets in the drop down menu does not |
726 |
|
have names and the menu is not contained in the Emacs GtkWindow. |
727 |
|
To have all menus in Emacs look the same, use this in @file{~/.emacs.d/gtkrc}: |
728 |
|
|
729 |
|
@smallexample |
730 |
|
widget_class "*Menu*" style "my_menu_style" |
731 |
|
@end smallexample |
732 |
|
|
733 |
|
@node GTK styles |
734 |
|
@appendixsubsec GTK styles |
735 |
|
@cindex GTK styles |
736 |
|
|
737 |
|
In a GTK style you specify the appearance widgets shall have. You |
738 |
|
can specify foreground and background color, background pixmap and font. |
739 |
|
The edit widget (where you edit the text) in Emacs is a GTK widget, |
740 |
|
but trying to specify a style for the edit widget will have no effect. |
741 |
|
This is so that Emacs compiled for GTK is compatible with Emacs compiled |
742 |
|
for other X toolkits. The settings for foreground, background and font |
743 |
|
for the edit widget is taken from the X resources; @pxref{Resources}. |
744 |
|
Here is an example of two style declarations, ``default'' and ``ruler'': |
745 |
|
|
746 |
|
@smallexample |
747 |
|
|
748 |
|
pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps" |
749 |
|
|
750 |
|
style "default" |
751 |
|
@{ |
752 |
|
font_name = "helvetica 12" |
753 |
|
|
754 |
|
bg[NORMAL] = @{ 0.83, 0.80, 0.73 @} |
755 |
|
bg[SELECTED] = @{ 0.0, 0.55, 0.55 @} |
756 |
|
bg[INSENSITIVE] = @{ 0.77, 0.77, 0.66 @} |
757 |
|
bg[ACTIVE] = @{ 0.0, 0.55, 0.55 @} |
758 |
|
bg[PRELIGHT] = @{ 0.0, 0.55, 0.55 @} |
759 |
|
|
760 |
|
fg[NORMAL] = "black" |
761 |
|
fg[SELECTED] = @{ 0.9, 0.9, 0.9 @} |
762 |
|
fg[ACTIVE] = "black" |
763 |
|
fg[PRELIGHT] = @{ 0.9, 0.9, 0.9 @} |
764 |
|
|
765 |
|
base[INSENSITIVE] = "#777766" |
766 |
|
text[INSENSITIVE] = @{ 0.60, 0.65, 0.57 @} |
767 |
|
|
768 |
|
bg_pixmap[NORMAL] = "background.xpm" |
769 |
|
bg_pixmap[INSENSITIVE] = "background.xpm" |
770 |
|
bg_pixmap[ACTIVE] = "background.xpm" |
771 |
|
bg_pixmap[PRELIGHT] = "<none>" |
772 |
|
|
773 |
|
@} |
774 |
|
|
775 |
|
style "ruler" = "default" |
776 |
|
@{ |
777 |
|
font_name = "helvetica 8" |
778 |
|
@} |
779 |
|
|
780 |
|
@end smallexample |
781 |
|
|
782 |
|
The style ``ruler'' inherits from ``default''. This way you can build |
783 |
|
on existing styles. The syntax for fonts and colors is described below. |
784 |
|
|
785 |
|
As this example shows, it is possible to specify several values |
786 |
|
for foreground and background depending on which state the widget has. |
787 |
|
The possible states are |
788 |
|
@table @code |
789 |
|
@item NORMAL |
790 |
|
This is the default state for widgets. |
791 |
|
@item ACTIVE |
792 |
|
This is the state for a widget that is ready to do something. It is |
793 |
|
also for the trough of a scroll bar, i.e. @code{bg[ACTIVE] = "red"} |
794 |
|
sets the scroll bar trough to red. Buttons that have been pressed but |
795 |
|
not released yet (``armed'') are in this state. |
796 |
|
@item PRELIGHT |
797 |
|
This is the state when widgets that can be manipulated have the mouse |
798 |
|
pointer over them. For example when the mouse is over the thumb in the |
799 |
|
scroll bar or over a menu item. When the mouse is over a button that |
800 |
|
is not pressed, the button is in this state. |
801 |
|
@item SELECTED |
802 |
|
This is the state when some data has been selected by the user. It can |
803 |
|
be selected text or items selected in a list. |
804 |
|
There is no place in Emacs where this setting has any effect. |
805 |
|
@item INSENSITIVE |
806 |
|
This is the state for widgets that are visible, but they can not be |
807 |
|
manipulated like they normally can. For example, buttons that can't be |
808 |
|
pressed and menu items that can't be selected. |
809 |
|
Text for menu items that are not available can be set to yellow with |
810 |
|
@code{fg[INSENSITIVE] = "yellow"}. |
811 |
|
@end table |
812 |
|
|
813 |
|
Here are the things that can go in a style declaration: |
814 |
|
|
815 |
|
@table @code |
816 |
|
@item bg[@var{state}] = @var{color} |
817 |
|
This is the background color widgets use. This background is not used for |
818 |
|
editable text, use @code{base} for that. |
819 |
|
|
820 |
|
@item base[@var{state}] = @var{color} |
821 |
|
This is the background color for editable text. |
822 |
|
In Emacs, this color is used for the background of the text fields in the |
823 |
|
file dialog. |
824 |
|
|
825 |
|
@item bg_pixmap[@var{state}] = "@var{pixmap}" |
826 |
|
You can specify a pixmap to be used instead of the background color. |
827 |
|
@var{pixmap} is a file name. GTK can use a number of file formats, |
828 |
|
including XPM, XBM, GIF, JPEG and PNG. If you want a widget to use the same |
829 |
|
pixmap as its parent, use @samp{<parent>}. If you don't want any |
830 |
|
pixmap use @samp{<none>}. Using @samp{<none>} can be useful |
831 |
|
if your style inherits a style that does specify a pixmap. |
832 |
|
|
833 |
|
GTK looks for the pixmap in directories specified in @code{pixmap_path}. |
834 |
|
It is not possible to refer to a file by its absolute path name. |
835 |
|
@code{pixmap_path} is a colon-separated list of directories within double |
836 |
|
quotes, specified at the top level in a @file{gtkrc} file (i.e. not inside |
837 |
|
a style definition; see example above): |
838 |
|
|
839 |
|
@smallexample |
840 |
|
pixmap_path "/usr/share/pixmaps:/usr/include/X11/pixmaps" |
841 |
|
@end smallexample |
842 |
|
|
843 |
|
@item fg[@var{state}] = @var{color} |
844 |
|
This is the foreground color widgets use. This is the color |
845 |
|
of text in menus and buttons. It is also the color for the arrows in the |
846 |
|
scroll bar. For editable text, use @code{text}. |
847 |
|
|
848 |
|
@item text[@var{state}] = @var{color} |
849 |
|
This is the color for editable text. In Emacs, this color is used for the |
850 |
|
text fields in the file dialog. |
851 |
|
|
852 |
|
@item font_name = "@var{font}" |
853 |
|
This is the font a widget shall use. @var{font} is a Pango font name, |
854 |
|
for example ``Sans Italic 10'', ``Helvetica Bold 12'', ``Courier 14'', |
855 |
|
``Times 18''. See below for exact syntax. The names are case insensitive. |
856 |
|
@end table |
857 |
|
|
858 |
|
Colors are specified in three ways, a name, a hexadecimal form or |
859 |
|
an RGB triplet. |
860 |
|
|
861 |
|
@noindent |
862 |
|
A color name is written within double quotes, for example @code{"red"}. |
863 |
|
|
864 |
|
@noindent |
865 |
|
A hexadecimal form is written within double quotes. There are four forms, |
866 |
|
@code{#rrrrggggbbbb}, @code{#rrrgggbbb}, |
867 |
|
@code{#rrggbb}, or @code{#rgb}. In each of these r, g and b are hex digits. |
868 |
|
|
869 |
|
@noindent |
870 |
|
An RGB triplet looks like @code{@{ r, g, b @}}, where r, g and b are either |
871 |
|
integers in the range 0-65535 or floats in the range 0.0-1.0. |
872 |
|
|
873 |
|
Pango font names have the form ``@var{family-list} @var{style-options} |
874 |
|
@var{size}''. |
875 |
|
@cindex Pango font name |
876 |
|
@noindent |
877 |
|
@var{family-list} is a comma separated list of font families optionally |
878 |
|
terminated by a comma. This way you can specify several families and the |
879 |
|
first one found will be used. @var{family} corresponds to the second part in |
880 |
|
an X font name, for example in |
881 |
|
|
882 |
|
@smallexample |
883 |
|
-adobe-times-medium-r-normal--12-120-75-75-p-64-iso10646-1 |
884 |
|
@end smallexample |
885 |
|
|
886 |
|
@noindent |
887 |
|
the family name is ``times''. |
888 |
|
|
889 |
|
@noindent |
890 |
|
@var{style-options} is a whitespace separated list of words where each word |
891 |
|
is a style, variant, weight, or stretch. The default value for all of |
892 |
|
these is @code{normal}. |
893 |
|
|
894 |
|
@noindent |
895 |
|
A `style' corresponds to the fourth part of an X font name. In X font |
896 |
|
names it is the character ``r'', ``i'' or ``o''; in Pango font names the |
897 |
|
corresponding values are @code{normal}, @code{italic}, or @code{oblique}. |
898 |
|
|
899 |
|
@noindent |
900 |
|
A `variant' is either @code{normal} or @code{small-caps}. |
901 |
|
Small caps is a font with the lower case characters replaced by |
902 |
|
smaller variants of the capital characters. |
903 |
|
|
904 |
|
@noindent |
905 |
|
Weight describes the ``boldness'' of a font. It corresponds to the third |
906 |
|
part of an X font name. It is one of @code{ultra-light}, @code{light}, |
907 |
|
@code{normal}, @code{bold}, @code{ultra-bold}, or @code{heavy}. |
908 |
|
|
909 |
|
@noindent |
910 |
|
Stretch gives the width of the font relative to other designs within a |
911 |
|
family. It corresponds to the fifth part of an X font name. It is one of |
912 |
|
@code{ultra-condensed}, @code{extra-condensed}, @code{condensed}, |
913 |
|
@code{semi-condensed}, @code{normal}, @code{semi-expanded}, |
914 |
|
@code{expanded}, @code{extra-expanded}, or @code{ultra-expanded}. |
915 |
|
|
916 |
|
@noindent |
917 |
|
@var{size} is a decimal number that describes the font size in points. |