Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!imagen!hedley From: hedley@imagen.UUCP (Hedley Rainnie) Newsgroups: comp.sys.atari.st Subject: Re: Who have I clobbered? (GEM windows) Summary: Here is code for Dialog boxes Keywords: GEM redraw rectangle Message-ID: <3121@imagen.UUCP> Date: 27 Feb 89 18:28:33 GMT References: <7829@chinet.chi.il.us> Organization: Imagen Corp., Santa Clara CA Lines: 58 saj@chinet.chi.il.us (Stephen Jacobs) writes about dialog trashing. Here is my code for dialogs. You will get a redraw event upon closing the dialog if things are set up right. No muss no fuss. This code works so enjoy! (Its actually part of the user interface from UltraScript). Here is code to pop up the dialog. wind_update(BEG_UPDATE); form_center(who,diptr); form_dial(0,1,1,1,1,dibox); form_dial(1,1,1,1,1,dibox); objc_draw(who,ROOT,MAX_DEPTH,dibox); what = form_do(who,0); form_dial(2,1,1,1,1,dibox); form_dial(3,1,1,1,1,dibox); wind_update(END_UPDATE); (who+1)->ob_state = NORMAL; /* Select off */ And here is my code to redraw here: do_redraw(msg) int msg[]; { int whandle; GRECT t1,t2; int clip[4]; lineaa(); /* Mouse off */ whandle = msg[3]; t2.g_x = msg[4]; t2.g_y = msg[5]; t2.g_w = msg[6]; t2.g_h = msg[7]; wind_update(BEG_UPDATE); wind_get(whandle,WF_FIRSTXYWH,&t1.g_x,&t1.g_y,&t1.g_w,&t1.g_h); while(t1.g_w && t1.g_h) { if(rc_intersect(&t2,&t1)) { clip[0] = t1.g_x; clip[1] = t1.g_y; clip[2] = t1.g_x + t1.g_w - 1; clip[3] = t1.g_y + t1.g_h - 1; vs_clip(vdihandle,1,clip); /* Redraw your stuff here */ } wind_get(whandle,WF_NEXTXYWH,&t1.g_x,&t1.g_y,&t1.g_w,&t1.g_h); } wind_update(END_UPDATE); linea9(); /* Mouse on. I would use graf_mouse BUT that is another story */ } -- {decwrl!sun}!imagen!hedley hedley@imagen.com