[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2331.0. "Needed: Routine to send text to remote window" by JOCK::HENRICKSEN (Icy Lady I) Wed Feb 21 1990 22:24

    Hello,

    I have searched the both the DECwindows Programming and the DECwindows
    conferences, but was unable to find a solution to my problem.

    I have written code, using "C" and UIL, that creates multiple windows
    on a screen.  I need "C" only code - a routine - that can send a stream
    of text to any of the windows.  This routine must be able to be called
    by an outside program.  The calling program will send a stream of text
    and an id indicating which of the windows to display it on.

    I am using VMS and this will be run on a 3900 (if that matters.)  I
    have seen code that creates a window and then reads a user's input from
    the screen; but, it was using system calls and the window the text was
    displayed on was created locally.

    If anyone has any suggestions or coding examples they'd be GREATLY
    appreciated!  I am under a time constraint.  Thanks in advance,

    						- Ingrid
    
T.RTitleUserPersonal
Name
DateLines
2331.1GOSOX::RYANDECwindows MailThu Feb 22 1990 08:1429
	It sounds like a combination of XSendEvent and X selections should
	do the job. 

	Use XInternAtom in each involved program to create a couple of 
	private atoms for communication (i.e., _DEC_YOURAPP_ASK_FOR_SEL,
	_DEC_YOURAPP_SELECTION).

	Use XtAddEventHandler to set up a client message event handler on
	each of the window ID's that want to display the text.

	When the program receives the text and list of window ID's, call
	XtOwnSelection to grab the _DEC_YOURAPP_SELECTION, and use
	XSendEvent to send a ClientMessage to each window ID in the list
	with type _DEC_YOURAPP_ASK_FOR_SEL. It's selection convert
	handler should be set up to respond to selection request with
	the supplied text.

	The client message handler for each window should call
	XtGetSelectionValue to get the value of the _DEC_YOUR_APP_SELECTION
	selection. The callback will get the text, and you can then
	display it.

	I don't know of any applications which operate in quite this
	way, but doing a search of the DW_EXAMPLES and DECWINDOWS_PROGRAMMING
	conferences for the routine names I mentioned (particularly
	XSendEvent and XtGetSelectionValue) should be helpful for
	example code.

	Mike