Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!dimacs.rutgers.edu!bcm!convex!mdonahue From: mdonahue@convex.com (Mike Donahue) Newsgroups: comp.windows.x Subject: Menus in Xview Message-ID: <1991Feb04.205249.26761@convex.com> Date: 4 Feb 91 20:52:49 GMT Sender: news@convex.com (news access account) Distribution: usa Organization: Convex Computer Corporation, Richardson, Tx. Lines: 75 Nntp-Posting-Host: neptune.convex.com I have been attempting to port some sunview programs to Xview and have had some mild success, however, I have a program which uses several of the menu widgets from Xview and I cannot get it to work when I attempt to pop up the menu with a menu_show I get this error message : XView warning: menu_show: menu not owned by this server (Command Menu package) endless tweeking of the code did not seem to help so I typed in the simple menu program found in the Xview manual and it seems to do the same thing Code Follows (from X manual 7 : 236) -------------------------------------------------------------------- . . . initialization stuff . . . canvas = (Canvas)xv_create(frame, CANVAS, XV_WIDTH, 300, XV_HEIGHT, 200, NULL); scrollbar = (Scrollbar)xv_create(canvas,SCROLLBAR, SCROLLBAR_DIRECTION, SCROLLBAR_VERTICAL, NULL); M_menu = (Menu)xv_create(canvas,MENU, MENU_TITLE_ITEM, "Scrollbar", MENU_STRINGS,"On","Off",NULL, MENU_NOTIFY_PROC, menu_notify_proc, XV_KEY_DATA, SCROLLBAR_KEY, scrollbar, NULL); xv_set(canvas_paint_window(canvas), WIN_EVENT_PROC, pw_event_proc, XV_KEY_DATA, MENU_KEY, menu,NULL); window_fit(frame); window_main_loop(frame); } void menu_notify_proc(menu, menu_item) Menu menu; Menu_item menu_item; { char *menu_choice = (char *)xv_get(menu_item, MENU_STRING); int show_it = !strcmp(menu_choice,"On"); xv_set(xv_get(menu,XV_KEY_DATA,SCROLLBAR_KEY), XV_SHOW, show_it, NULL); } void pw_event_proc(canvas_pw,event) Xv_window canvas_pw; Event *event; { if (event_action(event) == ACTION_MENU && event_is_down(event)) { Menu menu = (Menu)xv_get(canvas_pw, XV_KEY_DATA, MENU_KEY); menu_show(M_menu,canvas_pw,event, NULL); } } At any rate this code gets the same error as above. Has anyone encountered this before ? Any suggestions or hints ? Am I missing something fundamental here ? Mike Donahue (mdonahue@convex.com) 214-497-4051