Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!ukc!harrier.ukc.ac.uk!rlh2 From: rlh2@ukc.ac.uk (R.L.Hesketh) Newsgroups: comp.windows.x Subject: Re: Help on distributed user interfaces Keywords: X, Widgets, distributed workstations Message-ID: <2757@harrier.ukc.ac.uk> Date: 15 Oct 89 21:55:34 GMT References: <7639@bunny.GTE.COM> Reply-To: rlh2@ukc.ac.uk (R.L.Hesketh) Organization: Computing Lab, University of Kent at Canterbury, UK. Lines: 58 In article <7639@bunny.GTE.COM> vp01@GTE.COM (Vincent Phuah) writes: >Hi there, hello >I am looking for suggestions on how to implement the following >problem prefably using widgets and the X Intrinsics. good man 8-} > >Problem: > > How to implement an X client running on one workstation > that is able to control, when required, the user-interface interactions of > the same client running on another workstation and vice-versa. There is a very good book which covers just this subject in a whole chapter on Inter-Client Communication. The book is the (now-famous?) X Window Systems Programming and Applications With Xt by Douglas Young, published by Prentice-Hall. Sorry I don't have my copy with me so I can't give the ISBN Essentially you could use a combination of Window Properties and XSendEvent() calls. You set up a "connection" between the two applications by setting a property on a window known to both applications, the root window will do. You could use two properties for each application one giving the Display and one giving the window id to send events to. This is described in much better terms in Doug's book .. I recommend you by a copy! Anyway, once each application knows the others display and the id. of the window, which would in this case be the scrollbar widget's window. They can send events to the others scrollbar by calling XSendEvent() with the other applications display and window id. Say WA has been pressed .. whenever the scrollbar of WA gets moved a copy of the event that caused the scrollbar to move will be sent to the other application, WB. The other application will get this event just like any other from the server .. the only difference is that this event has the "send_event" field set to true. The window and display ids. should be set to those of the window that the event is going to .. otherwise the toolkit will not be able to dispatch it properly. I have used this same approach to produce remote Xt{Set,Get}Values() calls that allow one program to change anothers resources ... the basis of an interactive resource editor. Hope that helps, Richard Richard Hesketh : rlh2@ukc.ac.uk ..!mcvax!ukc!rlh2 : @nsfnet-relay.ac.uk:rlh2@ukc.ac.uk --- Computing Lab., University of Kent at Canterbury, Canterbury, Kent, CT2 7NF, United Kingdom. Tel: (0227) 764000 ext. 3682