[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

38.17 Buttons

The button package defines functions for inserting and manipulating clickable (with the mouse, or via keyboard commands) buttons in Emacs buffers, such as might be used for help hyper-links, etc. Emacs uses buttons for the hyper-links in help text and the like.

A button is essentially a set of properties attached (via text properties or overlays) to a region of text in an Emacs buffer. These properties are called button properties.

One of these properties (action) is a function, which will be called when the user invokes it using the keyboard or the mouse. The invoked function may then examine the button and use its other properties as desired.

In some ways the Emacs button package duplicates functionality offered by the widget package (voir (widget)Top section `Introduction' dans The Emacs Widget Library), but the button package has the advantage that it is much faster, much smaller, and much simpler to use (for elisp programmers—for users, the result is about the same). The extra speed and space savings are useful mainly if you need to create many buttons in a buffer (for instance an *Apropos* buffer uses buttons to make entries clickable, and may contain many thousands of entries).


Ce document a été généré par Eric Reinbold le 13 Octobre 2007 en utilisant texi2html 1.78.