Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!ucsd!pacbell.com!ames!bionet!agate!ucbvax!rchland.iinus1.ibm.com!dgross From: dgross@rchland.iinus1.ibm.com (Dave Gross) Newsgroups: comp.soft-sys.andrew Subject: bug in proctable? Message-ID: <0bVBezI91E6J47W48A@rchland.ibm.com> Date: 4 Jan 91 19:42:55 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Dave Gross Organization: The Internet Lines: 71 There seems to be a bug in proctable. I am trying to add a DeleteWindow option to my application's menu list. I want to call the proctableentry for "frame-delete-window". The following (simplified)code is from my InitializeClass: First I tried: struct menulist *myview_menulist = menulist_New(); struct keymap *myview_keymap = keymap_New(); struct proctable_Entry *proc; proc = proctable_Lookup( "frame-delete-window" ); /* find proctable entry */ if ( proc != NULL ) { keymap_BindToKey( myview_keymap, ATK_CTRL_X ATK_CTRL_D, proc, 0 ); menulist_AddToML( myview_menulist, ",Delete Window~12", proc, 0, MASK1 ); } The menu option came up, but selecting it did nothing. Then I tried making myown proctable entry which would be passed the frame. Note theclass_Load("frame"). proc = proctable_DefineProc("myview-delete-window", deleteWindow, class_Load("frame"), NULL,"delete the current window"); if ( proc != NULL ) { keymap_BindToKey( myview_keymap, ATK_CTRL_X ATK_CTRL_D, proc, 0 ); menulist_AddToML( myview_menulist, ",Delete Window~12", proc, 0, MASK1 ); } Again, the menu option came up, but selecting it did nothing. In fact, theroutine deleteWindow was not even called! The prototype looked like: static void deleteWindow( struct frame *fr,long ignore ); I also tried inserting a call to proctable_ForceLoaded(proc) in both ofthe above examples. No change... So, I tried passing my own classinfo to the function. Note the&myview_classinfo. proc = proctable_DefineProc("myview-delete-window", deleteWindow, &myview_classinfo, NULL, "deletethe current window"); if ( proc != NULL ) { keymap_BindToKey( myview_keymap, ATK_CTRL_X ATK_CTRL_D, proc, 0 ); menulist_AddToML( myview_menulist, ",Delete Window~12", proc, 0, MASK1 ); } with the function prototype as: static void deleteWindow( struct myview *self, longignore ); This worked. My function was called when selected from the menu. The problemis, there still is no way for me to call "frame-delete-window". Itried "faking" a delete window by destroying the IM, but that just caused coredumps. Is this a bug in proctable or is there something else I should be doing. Note: I don't want to add this to my whole applicationvia an initfile addmenu. Any advice would be greatly appreciated. Thanks, -- Dave