Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!sgi!shinobu!odin!horus.esd.sgi.com!thant From: thant@horus.esd.sgi.com (Thant Tessman) Newsgroups: comp.sys.sgi Subject: Re: drawing in subwindows Message-ID: <1990Aug15.171153.22969@odin.corp.sgi.com> Date: 15 Aug 90 17:11:53 GMT References: <1990Aug14.100020.5096@hellgate.utah.edu> Sender: news@odin.corp.sgi.com (Net News) Reply-To: thant@horus.esd.sgi.com (Thant Tessman) Organization: Silicon Graphics Inc. Lines: 43 In article <1990Aug14.100020.5096@hellgate.utah.edu>, margaret@cs.utah.edu (Malgorzata Sturgill) writes: > > Hi, > I am trying to draw in subwindows ( open with swinopen ). I finally > managed to persuade my code to draw, but unfortunately it does not draw where > I expect. I have included a piece of code to ilustrate. All this program does > it opens a 300x300 parent window (black) and then opens a white 200x200 white > subwindow. the program is then supposed to draw the diagonals of the subwindow > in red. Well it does not. It does draw a cross, but it does not fill the whole > window. Am I just doing something stupid? > #include I'm not sure what the default behavior of subwindows is supposed to be, but you could just add an ortho2 to your redr to get what you want: redr(){ winset(child); reshapeviewport(); ortho2(0.0, 200.0, 0.0, 200.0); /* like this */ color(WHITE); clear(); color(RED); move2(0,0); draw2(199,199); move2(0,199); draw2(199,0); } > Malgorzata Marek Sturgill margaret@cs.utah.edu > margaret@ms.uky.edu > thant