home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.eiffel
- Path: sparky!uunet!ukma!wupost!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!zazen!purelogic!usenet
- From: butte_ms@pascal.uwlax.edu (Mike S. Butterbrodt S92)
- Subject: if then else strange things..
- Message-ID: <1992Nov17.164713.6958@purelogic.cs.uwlax.edu>
- Sender: usenet@purelogic.cs.uwlax.edu (News Poster)
- Nntp-Posting-Host: pascal.wing.uwlax.edu
- Organization: University of Wisconsin - La Crosse Computer Science Department
- Date: Tue, 17 Nov 1992 16:47:13 GMT
- Lines: 36
-
- Gotta neat problem......
-
- For a class we are creating a logic gate simulator. In one of the gates, we
- toggle the color with
- a mouse down event. (From Black to Light_gray).
-
- We are using Postscript commands on a NeXT enviroment, but that should be
- irrelevant for this problem.
-
-
- My first attempt was ::::
- -- When the gates are initially created status_color := Black;
-
- the mouse_down event method contains this (among other non-related things)
-
- if status_color = Light_gray then
- status_color := Black;
- else
- status_color := Light_gray;
- end;
- display;
- This changed the color to Light_gray, but would not change it back on
- successive mouse downs.
- However, this worked.....
-
- if status_color = Black then
- status_color := Light_gray;
- else
- status_color := Black;
- end;
- display;
-
- It works now, so I am happy. But this is very curious. Any answers???
-
- Mike Butterbrodt, UW_La Crosse Comp.
- Sci.
-