1. Home
  2. Computing & Technology
  3. Focus on Linux

LessTif Resources

Emacs Documentation

By Juergen Haas, About.com

LessTif Menu X Resources

If the Emacs installed at your site was built to use the X toolkit with the LessTif or Motif widgets, then the menu bar, the dialog boxes, the pop-up menus, and the file-selection box are separate widgets and have their own resources.

The resource names for the menu bar contain pane.menubar (following, as always, the name of the Emacs invocation, or Emacs, which stands for all Emacs invocations). Specify them like this:

Emacs.pane.menubar.subwidget.resource: value

Each individual string in the menu bar is a subwidget; the subwidget's name is the same as the menu item string. For example, the word File in the menu bar is part of a subwidget named emacs.pane.menubar.File. Most likely, you want to specify the same resources for the whole menu bar. To do this, use * instead of a specific subwidget name. For example, to specify the font 8x16 for the menu-bar items, write this:

Emacs.pane.menubar.*.fontList: 8x16

This also specifies the resource value for submenus.

Each item in a submenu in the menu bar also has its own name for X resources; for example, the File submenu has an item named Save (current buffer). A resource specification for a submenu item looks like this:

Emacs.pane.menubar.popup_*.menu.item.resource: value

For example, here's how to specify the font for the Save (current buffer) item:

Emacs.pane.menubar.popup_*.File.Save (current buffer).fontList: 8x16

For an item in a second-level submenu, such as Complete Word under Spell Checking under Tools, the resource fits this template:

Emacs.pane.menubar.popup_*.popup_*.menu.resource: value

For example,

Emacs.pane.menubar.popup_*.popup_*.Spell Checking.Complete Word: value

(This should be one long line.)

It's impossible to specify a resource for all the menu-bar items without also specifying it for the submenus as well. So if you want the submenu items to look different from the menu bar itself, you must ask for that in two steps. First, specify the resource for all of them; then, override the value for submenus alone. Here is an example:

Emacs.pane.menubar.*.fontList: 8x16 Emacs.pane.menubar.popup_*.fontList: 8x16

For LessTif pop-up menus, use menu* instead of pane.menubar. For example, to specify the font 8x16 for the pop-up menu items, write this:

Emacs.menu*.fontList: 8x16

For LessTif dialog boxes, use dialog instead of menu:

Emacs.dialog*.fontList: 8x16 Emacs.dialog*.foreground: hotpink

To specify resources for the LessTif file-selection box, use fsb*, like this:

Emacs.fsb*.fontList: 8x16

Here is a list of the specific resources for LessTif menu bars and pop-up menus:

Explore Focus on Linux

More from About.com

  1. Home
  2. Computing & Technology
  3. Focus on Linux
  4. Linux Software
  5. Editors
  6. Emacs
  7. Emacs Documentation - LessTif Resources

©2008 About.com, a part of The New York Times Company.

All rights reserved.