Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!ukma!rutgers!apple!agate!ucbvax!qt.ipa.fhg.de!mai From: mai@qt.ipa.fhg.de (Christoph Mai) Newsgroups: comp.soft-sys.andrew Subject: problems with menulists Message-ID: <9010191054.AA10459@lazy.qt.IPA.FhG.de> Date: 19 Oct 90 10:55:09 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 53 X-Unparsable-Date: Fri, 19 Oct 90 9:54:08 GMT-1:00 I got the following problem: In an application I wanted to open a new window with a frame and a text/textview inset. To add/delete some new menuitems to the textview I used the function menulist_ChainBeforeML with a 'newmenulist' previously created by { static struct bind_Description Bindings[]={ {NULL,NULL,0,"Quit",0,0,NULL,NULL}, {"Insert-Strings",NULL,0,"New Menu Card,Insert Strings",0,0,InsStrings, "Insert Strings"}, NULL }; } and in the Initialize Class function { struct classinfo *classinfo = class_Load("textview"); Newmenulist = menulist_New(); bind_BindList(Bindings,NULL,newmenulist,classinfo); } -------- Now, here is my function ---------------------- void opennewwindow() { struct textview *newtextView; struct text *newtext; struct frame *frame; struct im *newim; newtext = text_New(); newtextView = textview_New(); view_SetDataObject((struct view *)newtextView,(struct dataobject *)newtext); menulist_ChainBeforeML(newtextView->menus,newmenulist,0); frame = frame_New(); newIM = im_Create(NULL); frame_SetView(frame,newtextView); im_SetView(newIM,frame); } The new menu card appears in the card stack but the program core dumps immediately after chosing the new menu item. The other original menu items of textview don't cause any core dumps ! Is this a wrong way to change menus or what else could be wrong ?? Best regards --- Christoph ____________________________________________________________ Christoph Mai (chm@qt.IPA.FhG.de) Fraunhofer-Institut f. Produktionstechnik u. Automatisierung Eierstrasse 46,D-7000 Stuttgart 1