[comp.windows.open-look] Sticky Abbrev Menu Button Arrows

Lovstrand@EuroPARC.Xerox.COM (Lennart Lovstrand) (04/19/91)

OK, here's another one:

If you try to remove a PANEL_ABBREV_MENU_BUTTON while running its
action, the label will disappear but the little menu arrow will stay
behind.  The cause seems to be that the redisplay code for the button
insists of repainting the arrow (unshading it) even though both its
XV_SHOW attribute has been turned off and an xv_destroy_safe() action
has been issued against it.

Does anyone know about a fix or a workaround?

Thanks,
--Lennart

Here's a code fragment to repeat by:

#include <stdio.h>
#include <xview/xview.h>
#include <xview/panel.h>

Panel_item button;

void
menu_selection(menu, item)
    Menu menu;
    Menu_item item;
{
    xv_set(button, XV_SHOW, FALSE, NULL);
    xv_destroy_safe(button);
}

main(argc, argv)
    int argc;
    char **argv;
{
    Frame frame;
    Panel panel;
    Menu menu;

    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, 0);

    frame = xv_create(NULL, FRAME, NULL);
    
    panel = xv_create(frame, PANEL, NULL);

    menu = xv_create(NULL, MENU,
		     MENU_STRINGS, "foo", "bar", "baz", NULL,
		     MENU_NOTIFY_PROC, menu_selection,
		     NULL);

    button = xv_create(panel, PANEL_ABBREV_MENU_BUTTON,
		       PANEL_LABEL_STRING, "Hit me",
		       PANEL_ITEM_MENU, menu,
		       NULL);

    xv_main_loop(frame);
}

--
--Lennart <Lovstrand@EuroPARC.Xerox.COM>		R   _A _  N_   K
Rank Xerox EuroPARC, 61 Regent St, Cambridge, UK	\/ |_ |_) | | \/
Ackpft, Sun-4/75 at EuroPARC, SunOS Release 4(1.1)-2	/\ |_ | \ |_| /\
TOPS-20 Command processor 7(103)-2 [alpha]		E u r o  P A R C