Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!julius.cs.uiuc.edu!apple!ksand From: ksand@Apple.COM (Kent Sandvik) Newsgroups: comp.sys.mac.programmer Subject: Re: How to hide the menubar (again) Message-ID: <47136@apple.Apple.COM> Date: 6 Dec 90 01:32:07 GMT References: <13513@uswat.UUCP> Organization: Apple Computer Inc., Cupertino, CA Lines: 53 In article <13513@uswat.UUCP> russell@uswat.uswest.com (Russell Greenlee) writes: >I know that this has been thrashed out here in the past, but I don't >remember the outcome. I have been doing this by changing the GrayRgn >and setting the height of the menu bar to 0. This seems to work fine >on a Mac II, Mac Plus, or SE, but it leads to system crashes on an fx. >If anyone knows of a better way to do this, I'd love to hear it. How >does Hypercard do it? ...and the MBarHeight global is not supported under A/UX either... Here's one way to get this to work, i.e. you expand the window to cover the whole screen by setting the visRgn of the window to the size of the screenBits.bounds. Note that this method is not permanent because for instance dialogs will set the visRgn smaller than the screen bounds when they are called. So remember to restore the visRgn. Here's a bit of Pascal code that seems to do the trick, also with A/UX 2.0: Procedure FixIt; {does the trick of expanding the window so it occupies the whole screen} BEGIN MoveWindow( myWindow, ScreenBits.bounds.left, ScreenBits.bounds.top, TRUE ); SizeWindow( myWindow, ScreenBits.bounds.right-ScreenBits.bounds.left, ScreenBits.bounds.bottom-ScreenBits.bounds.top, FALSE ); showWindow( myWindow ); setPort( myWindow ); rectRgn( myWindow^.visRgn, ScreenBits.bounds ); invalRect( ScreenBits.bounds ); END; To restore the visRgn after calling up a dialog: RectRgn( myWindow^.visRgn, ScreenBits.bounds ); InvalRect( ScreenBits.bounds ); And remember, the Apple User Interface Police don't like people that create menu-less applications, unless it's a game, or presentation software, or a simstim deck. Hope this helps, Kent Sandvik -- Kent Sandvik, Apple Computer Inc, Developer Technical Support NET:ksand@apple.com, AppleLink: KSAND DISCLAIMER: Private mumbo-jumbo Zippy says: "With C++ we now do have the possibilities to inherit dangling pointer problems"