Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!ox.com!math.fu-berlin.de!ira.uka.de!fauern!unido!mcshh!abqhh!drdhh!bjoern From: bjoern@drdhh.hanse.de (Bjoern Kriews) Newsgroups: comp.sys.atari.st.tech Subject: Re: saving screen in a GEM app. Message-ID: <2972.04.91@drdhh.hanse.de> Date: 29 Apr 91 11:29:40 GMT References: <115241.1926@timbuk.cray.com> Organization: Digital Island Lines: 65 From article <115241.1926@timbuk.cray.com>, by marc@sequoia.cray.com (Marc Bouron): > |> I am writing a GEM application based on a dialog box which > |> occasionally has another dialog box written over it. When this > |> 'pop-up' dialog box is done and I have called form_dial() the second > |> time, instead of the original dialog box being restored, the desktop > |> background is restored. Obviously, that doesn't 'cut it'. Is there a > |> way for me to save the background and restore it when I'm done with > |> the 'pop-up' dialog? GEM's form_dial is just a way to tell the screen manager that it has to force the application to redraw it's screen. Since dialogs are not windows, you have to use code like this: form_center(dial1,...); form_center(popup,...); redraw=TRUE; form_dial(FMD_START,dial1....); do{ if(redraw) { objc_draw(dial1,....); redraw=FALSE; } ex=form_do(dial1...) & 0x7fff; switch(ex) { case CALLPOP: form_dial(FMD_START,popup...); /* not needed if popup is < dial */ objc_draw(popup,....); form_do(popup,....); form_dial(FMD_FINISH,popup....); /* "" */ redraw=TRUE; break; case ANYTHING: form_alert(1,"[0][What you want][XXX]"); break; } } while(ex != EXDIAL1); form_dial(FMD_FINISH,dial1....); I hacked this from memory because my sources are on backup for the moment, but that's the way my applications handle it. Notes: Alerts restore there bg automatically. I discovered that form_dial(START/FINISH) may be used out of specific order but I never found this being official, be aware. Hope that helps, Bjoern --- bjoern@drdhh.hanse.de = Bjoern Kriews / Stormsweg 6 / 2000 Hamburg 76 / FRG "gaaga mahwe Bjoern urgl ufzae Turbo-C bnub" (J. Willamowius)