home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / eiffel / 1312 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.6 KB  |  48 lines

  1. Newsgroups: comp.lang.eiffel
  2. Path: sparky!uunet!ukma!wupost!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!zazen!purelogic!usenet
  3. From: butte_ms@pascal.uwlax.edu (Mike S. Butterbrodt S92)
  4. Subject: if then else  strange things..
  5. Message-ID: <1992Nov17.164713.6958@purelogic.cs.uwlax.edu>
  6. Sender: usenet@purelogic.cs.uwlax.edu (News Poster)
  7. Nntp-Posting-Host: pascal.wing.uwlax.edu
  8. Organization: University of Wisconsin - La Crosse Computer Science Department
  9. Date: Tue, 17 Nov 1992 16:47:13 GMT
  10. Lines: 36
  11.  
  12.  Gotta neat problem......
  13.  
  14.  For a class we are creating a logic gate simulator.  In one of the gates, we  
  15. toggle the color with
  16.  a mouse down event.  (From Black to Light_gray).  
  17.  
  18.  We are using Postscript commands on a NeXT enviroment, but that should be  
  19. irrelevant for this problem.   
  20.  
  21.  
  22.  My first attempt was ::::
  23.        -- When the gates are initially created      status_color :=  Black;
  24.        
  25.     the mouse_down event method contains this (among other non-related things)
  26.     
  27.                if  status_color = Light_gray then
  28.                status_color := Black;
  29.           else
  30.                 status_color := Light_gray;
  31.             end;     
  32.             display;
  33.  This changed the color to Light_gray, but would not change it back on  
  34. successive mouse downs.
  35.  However, this worked.....
  36.  
  37.                 if  status_color = Black then
  38.                status_color := Light_gray;
  39.           else
  40.                 status_color := Black;
  41.             end;     
  42.             display;
  43.  
  44. It works now, so I am happy.  But this is very curious.  Any answers???
  45.  
  46.                                          Mike Butterbrodt,  UW_La Crosse Comp.  
  47. Sci.
  48.