view oldXMenu/DelSel.c @ 39651:444f50200adc

(help-mode-map): Make button-buffer-map our parent. Don't bind mouse events or tab/backtab. (help-function, help-variable, help-face, help-coding-system) (help-input-method, help-character-set, help-back, help-info) (help-customize-variable, help-function-def, help-variable-def): New button types. (help-button-action): New function. (describe-function-1): Pass help button-types to `help-xref-button' rather than help function and help-echo string. Don't put multiple help-function args in a list to pass them to help-xref-button, just pass them as multiple arguments. Use `help-insert-xref-button' to make [back]-button, rather than `help-xref-button'. (help-xref-button): Take a button-type TYPE as a parameter rather than a function. Remove HELP-ECHO parameter. Remove DATA parameter and add a &rest parameter ARGS to serve the same purpose. Use `make-text-button' to add the button. (help-insert-xref-button): Use `insert-text-button' to add the button. (help-follow-mouse, help-next-ref, help-previous-ref): Functions removed. (help-do-xref): New function. (help-follow): Use `push-button' and `help-do-xref' to do most of the work.
author Miles Bader <miles@gnu.org>
date Sun, 07 Oct 2001 12:05:22 +0000
parents bbce331da1be
children 23a1cea22d13
line wrap: on
line source

#include "copyright.h"

/* $Header: /u/src/emacs/19.0/oldXMenu/RCS/DelSel.c,v 1.1 1992/04/11 22:10:18 jimb Exp $ */
/* Copyright    Massachusetts Institute of Technology    1985	*/

/*
 * XMenu:	MIT Project Athena, X Window system menu package
 *
 * 	XMenuDeleteSelection - Deletes a selection from an XMenu object.
 *
 *	Author:		Tony Della Fera, DEC
 *			20-Nov-85
 *
 */

#include "XMenuInt.h"

int
XMenuDeleteSelection(display, menu, p_num, s_num)
    register Display *display;	/* Previously opened display. */
    register XMenu *menu;	/* Menu object to be modified. */
    register int p_num;		/* Pane number to be deleted. */
    register int s_num;		/* Selection number to be deleted. */
{
    register XMPane *p_ptr;	/* Pointer to pane being deleted. */
    register XMSelect *s_ptr;	/* Pointer to selections being deleted. */
        
    /*
     * Find the right pane.
     */
    p_ptr = _XMGetPanePtr(menu, p_num);
    if (p_ptr == NULL) return(XM_FAILURE);

    /*
     * Find the right selection.
     */
    s_ptr = _XMGetSelectionPtr(p_ptr, s_num);
    if (s_ptr == NULL) return(XM_FAILURE);

    /*
     * Remove the selection from the association table.
     */
    XDeleteAssoc(display, menu->assoc_tab, s_ptr->window);

    /*
     * Remove the selection from the parent pane's selection
     * list and update the selection count.
     */
    emacs_remque(s_ptr);
    p_ptr->s_count--;

    /*
     * Destroy the selection transparency.
     */
    if (s_ptr->window) XDestroyWindow(display, s_ptr->window);
    
    /*
     * Free the selection's XMSelect structure.
     */
    free(s_ptr);

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

    /*
     * Return the selection number just deleted.
     */
    _XMErrorCode = XME_NO_ERROR;
    return(s_num);
}