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 |
533 |
If the Emacs installed at your site was built to use the GTK widget set, |
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 |
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 |
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 |
@file{~/.emacs.d/gtkrc} file; note that these files are only for |
537 |
customizing specific GTK widget features. To customize Emacs font, |
customizing specific GTK widget features. To customize Emacs font, |
538 |
background, faces etc., use the normal X resources, see @ref{Resources}. |
background, faces etc., use the normal X resources, see @ref{Resources}. |
539 |
|
|
568 |
|
|
569 |
If GTK at your site is installed under @var{prefix}, |
If GTK at your site is installed under @var{prefix}, |
570 |
the resource file syntax is fully described in the GTK API |
the resource file syntax is fully described in the GTK API |
571 |
document |
document |
572 |
@file{@var{prefix}/share/gtk-doc/html/gtk/gtk-resource-files.html}. |
@file{@var{prefix}/share/gtk-doc/html/gtk/gtk-resource-files.html}. |
573 |
@var{prefix} is usually @file{/usr} or @file{/usr/local}. |
@var{prefix} is usually @file{/usr} or @file{/usr/local}. |
574 |
You can find the same document online at |
You can find the same document online at |
586 |
@appendixsubsec GTK widget names |
@appendixsubsec GTK widget names |
587 |
@cindex GTK widget names |
@cindex GTK widget names |
588 |
|
|
589 |
Widgets are specified by widget class or by widget name. |
Widgets are specified by widget class or by widget name. |
590 |
The widget class is the type of the widget, for example @code{GtkMenuBar}. |
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. |
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 |
A widget always have a class but it is not mandatory to give a name to |
649 |
@cindex GTK widget classes |
@cindex GTK widget classes |
650 |
|
|
651 |
In Emacs the top level widget for a frame is a @code{GtkWindow} that |
In Emacs the top level widget for a frame is a @code{GtkWindow} that |
652 |
contains a @code{GtkVBox}. The @code{GtkVBox} contains the |
contains a @code{GtkVBox}. The @code{GtkVBox} contains the |
653 |
@code{GtkMenuBar} and a @code{GtkFixed} widget. |
@code{GtkMenuBar} and a @code{GtkFixed} widget. |
654 |
The vertical scroll bars, @code{GtkVScrollbar}, |
The vertical scroll bars, @code{GtkVScrollbar}, |
655 |
are contained in the @code{GtkFixed} widget. |
are contained in the @code{GtkFixed} widget. |
656 |
The text you write in Emacs is drawn in the @code{GtkFixed} widget. |
The text you write in Emacs is drawn in the @code{GtkFixed} widget. |
669 |
For the scroll bar, the absolute class name is: |
For the scroll bar, the absolute class name is: |
670 |
|
|
671 |
@smallexample |
@smallexample |
672 |
widget_class |
widget_class |
673 |
"GtkWindow.GtkVBox.GtkFixed.GtkVScrollbar" |
"GtkWindow.GtkVBox.GtkFixed.GtkVScrollbar" |
674 |
style "my_style" |
style "my_style" |
675 |
@end smallexample |
@end smallexample |
705 |
@end smallexample |
@end smallexample |
706 |
|
|
707 |
GTK absolute names are quite strange when it comes to menus |
GTK absolute names are quite strange when it comes to menus |
708 |
and dialogs. The names do not start with @samp{Emacs}, as they are |
and dialogs. The names do not start with @samp{Emacs}, as they are |
709 |
free-standing windows and not contained (in the GTK sense) by the |
free-standing windows and not contained (in the GTK sense) by the |
710 |
Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this: |
Emacs GtkWindow. To customize the dialogs and menus, use wildcards like this: |
711 |
|
|
720 |
affects Emacs but leaves other applications unaffected. |
affects Emacs but leaves other applications unaffected. |
721 |
For example, the drop down menu in the file dialog can not |
For example, the drop down menu in the file dialog can not |
722 |
be customized by any absolute widget name, only by an absolute |
be customized by any absolute widget name, only by an absolute |
723 |
class name. This is so because the widgets in the drop down menu does not |
class name. This is so because the widgets in the drop down menu does not |
724 |
have names and the menu is not contained in the Emacs GtkWindow. |
have names and the menu is not contained in the Emacs GtkWindow. |
725 |
To have all menus in Emacs look the same, use this in @file{~/.emacs.d/gtkrc}: |
To have all menus in Emacs look the same, use this in @file{~/.emacs.d/gtkrc}: |
726 |
|
|
766 |
bg_pixmap[NORMAL] = "background.xpm" |
bg_pixmap[NORMAL] = "background.xpm" |
767 |
bg_pixmap[INSENSITIVE] = "background.xpm" |
bg_pixmap[INSENSITIVE] = "background.xpm" |
768 |
bg_pixmap[ACTIVE] = "background.xpm" |
bg_pixmap[ACTIVE] = "background.xpm" |
769 |
bg_pixmap[PRELIGHT] = "<none>" |
bg_pixmap[PRELIGHT] = "<none>" |
770 |
|
|
771 |
@} |
@} |
772 |
|
|
788 |
This is the default state for widgets. |
This is the default state for widgets. |
789 |
@item ACTIVE |
@item ACTIVE |
790 |
This is the state for a widget that is ready to do something. It is |
This is the state for a widget that is ready to do something. It is |
791 |
also for the trough of a scroll bar, i.e. @code{bg[ACTIVE] = "red"} |
also for the trough of a scroll bar, i.e. @code{bg[ACTIVE] = "red"} |
792 |
sets the scroll bar trough to red. Buttons that have been pressed but |
sets the scroll bar trough to red. Buttons that have been pressed but |
793 |
not released yet (``armed'') are in this state. |
not released yet (``armed'') are in this state. |
794 |
@item PRELIGHT |
@item PRELIGHT |
817 |
|
|
818 |
@item base[@var{state}] = @var{color} |
@item base[@var{state}] = @var{color} |
819 |
This is the background color for editable text. |
This is the background color for editable text. |
820 |
In Emacs, this color is used for the background of the text fields in the |
In Emacs, this color is used for the background of the text fields in the |
821 |
file dialog. |
file dialog. |
822 |
|
|
823 |
@item bg_pixmap[@var{state}] = "@var{pixmap}" |
@item bg_pixmap[@var{state}] = "@var{pixmap}" |
844 |
scroll bar. For editable text, use @code{text}. |
scroll bar. For editable text, use @code{text}. |
845 |
|
|
846 |
@item text[@var{state}] = @var{color} |
@item text[@var{state}] = @var{color} |
847 |
This is the color for editable text. In Emacs, this color is used for the |
This is the color for editable text. In Emacs, this color is used for the |
848 |
text fields in the file dialog. |
text fields in the file dialog. |
849 |
|
|
850 |
@item font_name = "@var{font}" |
@item font_name = "@var{font}" |
861 |
|
|
862 |
@noindent |
@noindent |
863 |
A hexadecimal form is written within double quotes. There are four forms, |
A hexadecimal form is written within double quotes. There are four forms, |
864 |
@code{#rrrrggggbbbb}, @code{#rrrgggbbb}, |
@code{#rrrrggggbbbb}, @code{#rrrgggbbb}, |
865 |
@code{#rrggbb}, or @code{#rgb}. In each of these r, g and b are hex digits. |
@code{#rrggbb}, or @code{#rgb}. In each of these r, g and b are hex digits. |
866 |
|
|
867 |
@noindent |
@noindent |