Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!lambert From: lambert@unix.cis.pitt.edu (Michael H Lambert) Newsgroups: comp.windows.open-look Subject: XView bug on DECstation? Message-ID: <72003@unix.cis.pitt.edu> Date: 18 Dec 90 21:10:32 GMT Reply-To: lambert@unix.cis.pitt.edu (Michael H Lambert) Organization: Univ. of Pittsburgh, Comp & Info Sys Lines: 61 I have a question regarding the use of menu buttons under XView 2.0 on a DECstation. I have keyed in the program btn_menu.c from Dan Heller's XView Programming Manual (1989 copyright), section 7.7.2, page 146, and it does not appear to run correctly. The menu draws correctly the first time it is invoked, but on subsequent clicks in the menu button a white rectangle with no text is drawn where the menu should be. I compiled the application with the Gnu C compiler (OSF version 1.9.2.14, -traditional switch), and ran it under olwm with the X11R4 server. Has anyone seen this problem before? Is it just a bug in the example, or is there a work-around? The operating system is Ultrix 3.1. The sample program is as follows: /*---------- cut here -------------------- */ #include #include #include main(argc,argv) int argc; char *argv[]; { Frame frame; Panel panel; Menu menu; int selected(); void menu_proc(); xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL); frame= (Frame)xv_create(NULL, FRAME, NULL); panel= (Panel)xv_create(frame, PANEL, NULL); menu= (Menu)xv_create(NULL, MENU, MENU_NOTIFY_PROC, menu_proc, MENU_STRINGS, "Yes", "No", "Quit", NULL, NULL); (void) xv_create(panel, PANEL_BUTTON, PANEL_LABEL_STRING, "Y/N/Q", PANEL_NOTIFY_PROC, selected, PANEL_ITEM_MENU, menu, NULL); window_fit(panel); window_fit(frame); xv_main_loop(frame); } int selected (item, event) Panel_item item; Event *event; { printf("%s selected...\n", xv_get(item, PANEL_LABEL_STRING)); return(XV_OK); } void menu_proc(menu, menu_item) Menu menu; Menu_item menu_item; { printf("Menu Item: %s\n", xv_get(menu_item, MENU_STRING)); if (!strcmp((char *)xv_get(menu_item, MENU_STRING), "Quit")) exit(0); }