🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #1622

Re: tracking cursor motion in a separate process

#1622
From: Mark Linton
Date: Wed, 06 Jan 1993 17:45
35 lines
2657 bytes
In article <1993Jan6.162051.471@cbfsb.cb.att.com>, dac@cbnewsf.cb.att.com (david.a.copperman) writes:
|> I have two processes, A and B.  A is written in X (no higher-level
|> packages).  It puts up a single window.  Process B forks and execs
|> A, and waits for it to come up.  Then it extracts the id (the X type
|> is Window) of A's window.  Process A (the graphics controller for
|> a geographical information system) operates under the control of B.
|> B needs to track cursor motion in A's window, so it (B) can do
|> real-time screen-to-world coordinate conversion and show the coordinates
|> in a window owned by B.
|> 
|> B is to be written in a higher-level package.  What I need to able to
|> do is assign the Window of A's window to some object/widget/etc. in B, 
|> then register for cursor motion events.  I understand that I can do
|> X-level programming in a program written in IV.  But it's very important
|> to me to not have to access the X event queue in code separate from
|> IV's code that does that - frankly, I'm not smart enough.  I want B's
|> code to be absolutely event driven, and simple enough that only one
|> entity (i.e., IV) need be involved in controlling the X event queue.
|> Is there some class in IV that I can use in this fashion?  More
|> specifically, can I create some object to which I can assign A's
|> Window, register for cursor motion in that window, and IV will call
|> the event handler for me?

It sounds like you would need to write a subclass of the InterViews Window
class that is given an initial X window id instead of getting one as
the result of creating a window.

|> A separate question:  B needs to be able to poll events going on in
|> other software having nothing to do with the screen.  I do that
|> in a prototype using Xt via Xt signal (alarm) handling, and it's fine.
|> Can I do some analog to this in IV?

Signals are a bit dangerous.  Seems like it would be safer to set a timeout
on the X input and then do your polling.  You can use the timer features
of Dispatcher to do this with InterViews.
Technical Details
Message-ID: <1if5rrINN905@fido.asd.sgi.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!sgiblab!sgigate!odin!fido!marktwain.rad.sgi.com!linton
References: <1993Jan6.162051.471@cbfsb.cb.att.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!sgiblab!sgigate!odin!fido!marktwain.rad.sgi.com!linton
From: linton@marktwain.rad.sgi.com (Mark Linton)
Newsgroups: comp.windows.interviews
Subject: Re: tracking cursor motion in a separate process
Date: 6 Jan 1993 17:45:31 GMT
Organization: sgi
Lines: 35
Distribution: world
Message-ID: <1if5rrINN905@fido.asd.sgi.com>
References: <1993Jan6.162051.471@cbfsb.cb.att.com>
Reply-To: linton@marktwain.rad.sgi.com (Mark Linton)
NNTP-Posting-Host: marktwain.rad.sgi.com
Keywords: Xlib