MEGGIN@vm.epas.utoronto.ca (David Megginson) (12/09/89)
In response to the question about saving the menu bar: The menubar disappears when you execute a TOS program from a GEM program and then return (using the VDI escape functions to get a TOS screen). There are a couple of ways to save the menu bar. First, if your application is actually an application (ie. it owns the menu bar), just use menu_bar() to hide the menu before you run a program, and use it to redisplay the menu afterwards. If it is an accessory (be careful here!), call wind_get() with window handle 0 (DESK) to get the working area of the desktop, and you should be able to presume that everything from 0 to X with width Y is the menu bar (use the VDI raster functions to save it!). Good luck. David Megginson, Centre for Medieval Studies, Toronto
agostino@sherlock.cs.concordia.ca (DELIGIA agostino) (03/02/90)
Hi everyone! Could anyone explain to me how I can save the menu bar of some program from within an accessory which is to use the whole screen? It goes like this: I started writing an accessory prg and after coding the part which clears the screen, tried it. Everything went fine until I left the acc--the menu bar was gone. Then I remembered: I have to save the menu bar, but how? Any help would be greatly appreciated! Agostino Deligia agostino@sunkisd.cs.concordia.ca agostino@concour.cs.concordia.ca
steve@thelake.mn.org (Steve Yelvington) (03/04/90)
[In article <1886@clyde.concordia.ca>, agostino@sherlock.cs.concordia.ca (DELIGIA agostino) writes ... ] > Hi everyone! Could anyone explain to me how I can save the menu bar of some > program from within an accessory which is to use the whole screen? It goes > like this: I started writing an accessory prg and after coding the part which > clears the screen, tried it. Everything went fine until I left the acc--the > menu bar was gone. Then I remembered: I have to save the menu bar, but how? A long time ago, Moshe Braner posted a skeleton program for converting a TOS application to a desk accessory. In it, he saved the menu bar manually by copying the first 1520 bytes of the physical screen to a safe place, then copying it back when the ill-behaved desk accessory was ready to go back to sleep. You find the physical screen by calling Physbase(). The DA also calls form_dial with the desktop's dimensions to cause the screen manager to send redraw messages to any affected programs. I've tried it and it works fine on my system. I believe it's the technique he uses in the DA version of GNOME (GNOME's Not Ordinary Micro EMACS). The 1520-byte figure is fine for low, medium and high resolution, but it's not going to work on a Moniterm or Image Systems display. Anybody want to take a crack at a function that returns the proper size for the cheater's menubar buffer, based on GEM's notion of the screen size? -- Steve Yelvington at the lake in Minnesota UUCP path: ... umn-cs.cs.umn.edu!thelake!steve
agostino@sherlock.cs.concordia.ca (DELIGIA agostino) (03/04/90)
Well, thanx to Samuel Streeper and Greg Lindahl for providing me with the info on how to save the menu bar. I tried it and it works! I have another question about our almighty GEM. How exactly does GEM know when you intend to close a desk accessory? That is, how does GEM know when to send the message AC_CLOSE to evnt_multi? The few books I have on GEM do not go into much detail and I am confused. Again, I'd appreciate any help I can get! :-) -------------------------------- Agostino Deligia agostino@sunkisd.cs.concordia.ca agostino@concour.cs.concordia.ca --------------------------------