Sunview question

Patrick Thompson bnrmtv!thompson at ames.arc.nasa.gov
Sat Feb 4 00:24:19 AEST 1989


jao at megatest.uucp (John Oswalt) writes:
> I would like this subwindow to be a TEXTSW, but apparently I cannot
> recieve ascii events from a TEXTSW,  ...

You CAN receive ascii events in a TEXTSW.  What you have to do is register
an "interposer" function with the Notifier.  This will cause all events
directed towards your TEXTSW to be routed through your interposer function
before going to the Base event handler.

After you create your text subwindow, register your interposer function
using the function "notify_interpose_event_func".

For example:
	notify_interpose_event_func(my_textsw, My_Interposer, NOTIFY_SAFE);

"My_Interposer" might look something like this:

	static void
	My_Interposer(frame, event, arg, type)
	Frame   frame;
	Event *event;
	Notify_arg arg;
	Notify_event_type type;
	{
		.
		.
		.
		if (event_is_ascii(event))                  
		{
			ch = (char) event_id(event);
			.
			. 
			. 
		}
	}


- Pat

Patrick Thompson             UUCP: {amdahl, hplabs, ames}!bnrmtv!thompson
Los Gatos, California        ARPA: bnrmtv!thompson at ames.arpa
			     Work: (415) 940-2597  
"irie"                       Home: (408) 354-9615



More information about the Comp.sys.sun mailing list