Path: utzoo!attcan!uunet!cs.utexas.edu!hellgate.utah.edu!cs.utah.edu!margaret From: margaret@cs.utah.edu (Malgorzata Sturgill) Newsgroups: comp.sys.sgi Subject: drawing in subwindows Message-ID: <1990Aug14.100020.5096@hellgate.utah.edu> Date: 14 Aug 90 16:00:19 GMT Organization: U of Utah Mouse Hole Lines: 88 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? Any help would be great, m. ------------------ Code Follows --------------------------------------------- #include #include #include long parent, child; main(argc, argv) int argc; char *argv[]; { short data; foreground(); prefposition(500,800,500,800); parent = winopen("parent") ; gconfig(); reshapeviewport(); color(BLACK); clear(); child = swinopen(parent); winposition(50,250,50,250); gconfig(); color(WHITE); clear(); qenter(REDRAW,(short)child); while (TRUE){ while (qtest()){ switch(qread(&data)){ case REDRAW: if ((long)data == parent){ winset(parent); reshapeviewport(); color(BLACK); clear(); break; } if ((long)data == child){ redr(); printf("child redrawn\n"); } break; default: break; } } } } redr(){ winset(child); reshapeviewport(); 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 "A sphere isn't that simple when you get into higher dimensions - it's a bit non-flat." - Annonymous Malgorzata Marek Sturgill margaret@cs.utah.edu margaret@ms.uky.edu "A sphere isn't that simple when you get into higher dimensions