djones@megatest.UUCP (Dave Jones) (06/07/91)
Hi, it's me again. I'm frazzled. Pfftt! Textsw's are driving me nuts, and it's a short drive. For reasons we need not go into here, I'm switching from emacs to an OpenWindows text-editor. After almost seven years of emacs, my fingers have a mind of their own, so I thought I would use the XVIEW textsw's to make an editor that is almost like the standard one, but knows a few emacs key-sequences. I started such a thing once using sunview, and it did not seem too hard. I wish I could find the source code now, but I think I remember deleting it when I decided it would never be used. (Sob.) Here's the plan... I want to intercept all keyboard events. Most of them I want to pass on to the textsw's default event-handler. Some few I want to munge on my own, perhaps calling a textsw routine to fiddle with the buffer, et cetera. For example, I want ctrl-k to kill to the end of the line and store the killed text in the cut/copy-buffer. We object-oriented dudes call this profound technique "inheritance". Simple enough? I can't do it. When I attach a handler to the textsw directly, it does not receive the keyboard events. When I attach to a view on the textsw (a Xv_Window), I get the keyboard events just fine, but SO DOES THE DAMN TEXTSW! It does its thing after I get through doing my thing, willy-nilly. I've tried every combindation of WIN_EVENT_PROC, WIN_NOTIFY_SAFE_EVENT_PROC, et cetera that I can think of. I've read the XVIEW Programming Manual cover-to-cover (yuck!) and now about all I can do is put my index finger horizontally to lips and make burbling noises. What is the magic formula?