Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!torn!nott!cunews!freenet.carleton.ca!FreeNet.Carleton.CA!al938
From: al938@FreeNet.Carleton.CA (Steve Chepurny)
Subject: Re: VW 2.0: Moving a rectangle with the cursor.
Message-ID: <CzytA3.3B0@freenet.carleton.ca>
Sender: al938@freenet3.carleton.ca (Steve Chepurny)
Reply-To: al938@FreeNet.Carleton.CA (Steve Chepurny)
Organization: The National Capital FreeNet
References: <3b2m2c$it3@hpbblb.bbn.hp.com>  
Date: Mon, 28 Nov 1994 06:42:03 GMT
Lines: 55


In a previous article, charlie@bbn.hp.com (Karlheinz Blank) says:

>
>Hey guys,
>
>the following code shows an image 'flying' through the window:
>
>Smalltalk at: #TempWindow put: ScheduledWindow new.
>TempWindow label: 'Petra'.
>TempWindow openIn: (600@400 extent: 400 @400).
>
>" Cookbook Animating an image pg 649"
>
>|gc logo origin jump  |
>
>gc := TempWindow graphicsContext.
>logo :=LogoExample logo.
>
>10 timesRepeat: [
>	origin := 0@0.
>	jump := 3@3.
>
>	logo
>		follow: [origin:= origin +jump]
>		while: [origin x < 400]
>		on: gc.
>	]
>
>
>Now I want that the logo 'wanders' with my cursor til I press anywhere in that
>window the red button. 
>
>Thanks for your hints and ideas,
>
>
>cheers charlie
>
>-------------------------------
>email: charlie@hpbbn.bbn.hp.com
>
You can get the cursor position with: 

position := CursorManager arrow sense.

and then make the position of the logo equal to the above "position".

--Steve


--
-----------------------------------------------------------------------------
Steve Chepurny                     |         Carleton University
al938@freenet.carleton.ca      	   |         Psychology II    
------------------------------------------------------------------------------
