Path: utzoo!attcan!uunet!snorkelwacker!bu.edu!bucrf11.bu.edu!tjh From: tjh@bucrf11.bu.edu (Tim Hall) Newsgroups: comp.sys.sgi Subject: Re: Constraining cursor to a window Keywords: cursor, window, movement constraints Message-ID: <60895@bu.edu.bu.edu> Date: 18 Jul 90 14:07:15 GMT References: <156@cutmcvax.OZ> Sender: news@bu.edu.bu.edu Reply-To: tjh@bucrf11.bu.edu (Tim Hall) Organization: Boston University Lines: 22 In article <156@cutmcvax.OZ>, flint@cutmcvax.OZ (Danny Baldoni) writes: |> |> What I'd like to know is whether or not |> there's any way I can restrict the movement of the cursor so that it can |> NEVER (unless I release it) move outside the boundaries of one of those |> windows. |> Yes, find the boundaries of your window and then use 'setvaluator' to constrain the cursor. For example if the lower left of your window is at xmin/ymin and the upper right is at xmax/ymax the following... setvaluator( MOUSEX, ( xmax - xmin ) / 2, xmin, xmax ); setvaluator( MOUSEY, ( ymax - ymin ) / 2, ymin, ymax ); puts the cursor in the center of the window and constrains it within the window boundaries. However, if there is another window overlapping this window the cursor can enter it. -Tim Hall tjh@bu-pub.bu.edu