view oldXMenu/ChgPane.c @ 107687:328e54bec8c9

Document Message mode as the default mail mode. * sending.texi (Sending Mail): Document the fact that Message mode is now the default mail mode. (Mail Format, Mail Headers): Document mail-from-style changes. (Mail Commands): Rename from Mail mode. Document Message mode. (Mail Misc): Rename from Mail mode Misc. (Mail Sending, Header Editing, Mail Misc): Switch to Message mode command names and update keybindings. (Header Editing): Document message-tab. De-document mail-self-blind, mail-default-reply-to, and mail-archive-file-name in favor of mail-default-headers. Ad index entries for user-full-name and user-mail-address. (Citing Mail): Update changes in Message mode behavior. Document mail-yank-prefix. (Mail Signature): New node, moved from Mail Misc. (Mail Aliases): Mail abbrevs are the default with Message mode. (Mail Methods): Note that Message mode is now the default. * rmail.texi (Rmail Reply): * text.texi (Text Mode): * major.texi (Major Modes): * mule.texi (Output Coding): Refer to Message mode. * custom.texi (Init Examples): Add xref to Mail Header. * emacs.texi (Top): Fix xrefs.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 27 Mar 2010 23:41:34 -0400
parents d4f6522bb9d2
children e9f94688a064 5cc91198ffb2
line wrap: on
line source

/* Copyright    Massachusetts Institute of Technology    1985	*/

#include "copyright.h"


/*
 * XMenu:	MIT Project Athena, X Window system menu package
 *
 *	XMenuChangePane - Change the label of a  menu pane.
 *
 *	Author:		Tony Della Fera, DEC
 *			December 19, 1985
 *
 */

#include <config.h>
#include "XMenuInt.h"

int
XMenuChangePane(menu, p_num, label)
    register XMenu *menu;	/* Menu object to be modified. */
    register int p_num;		/* Pane number to be modified. */
    char *label;		/* Selection label. */
{
    register XMPane *p_ptr;	/* XMPane pointer. */

    int label_length;		/* Label length in characters. */
    int label_width;		/* Label width in pixels. */

    /*
     * Check for NULL pointers!
     */
    if (label == NULL) {
	_XMErrorCode = XME_ARG_BOUNDS;
	return(XM_FAILURE);
    }

    /*
     * Find the right pane.
     */
    p_ptr = _XMGetPanePtr(menu, p_num);
    if (p_ptr == NULL) return(XM_FAILURE);

    /*
     * Determine label size.
     */
    label_length = strlen(label);
    label_width = XTextWidth(menu->p_fnt_info, label, label_length);

    /*
     * Change the pane data.
     */
    p_ptr->label = label;
    p_ptr->label_width = label_width;
    p_ptr->label_length = label_length;

    /*
     * Schedule a recompute.
     */
    menu->recompute = 1;

    /*
     * Return the pane number just changed.
     */
    _XMErrorCode = XME_NO_ERROR;
    return(p_num);
}

/* arch-tag: e267e9de-a3f0-4a0d-8c45-413afa176fd8
   (do not change this comment) */