From - Sat Sep 21 23:15:15 1996 Path: news.unizar.es!news.rediris.es!news.belnet.be!swsbe6.switch.ch!swidir.switch.ch!in2p3.fr!univ-lyon1.fr!jussieu.fr!math.ohio-state.edu!cs.utexas.edu!nntp.primenet.com!cpk-news-hub1.bbnplanet.com!newsfeed.internetmci.com!in1.uu.net!spool.news.idt.net!hingham87.pcix.com!user From: paulba19@mail.idt.net (Paul Baxter) Newsgroups: comp.sys.mac.programmer.help Subject: Re: Menu Bar Tricks Date: Tue, 17 Sep 1996 16:07:11 -0500 Organization: IDT Corporation Lines: 113 Message-ID: References: NNTP-Posting-Host: hingham87.pcix.com In article , jmerrima@ix.netcom.com (Jonathan Merriman) wrote: > Does anybody know how to replace the menu bar pattern? Hide it ? > > -Jonathan Merriman > > --------------------------------------------------------------------- > Jonathan Merriman | Marathon Maniac Monthly > jmerrima@ix.netcom.com | Mail me if you want to pre-order. > --------------------------------------------------------------------- > http://www.netcom.com/~jmerrima/ > --------------------------------------------------------------------- Hi, To Hide the menubar try: /* CODE EXAMPLE #1 */ /* * How to hide the menubar * This code sample shows how to hide the menubar. It isn't something that you * should really be doing (see the Apple Q&A stack for more), and the extra * space might not 'work' ok (ie, it might not receive mouse-clicks and such), but * it will enable you to draw on (or just obscure) the menu bar. Also, you should * avoid calling ExitToShell without first calling ShowMenuBar, because you'll * find that you have no menu bar. This code hasn't been tested with multiple monitor * environments. */ // Assumes inclusion of void Init(void); void HideMenuBar(void); void ShowMenuBar(void); void Init(void) { InitGraf(&thePort); InitFonts(); InitWindows(); TEInit(); InitDialogs(nil); InitCursor(); } short oldMBarHeight; RgnHandle mBarRgn; void HideMenuBar() { RgnHandle gray; Rect mBarRect; gray = LMGetGrayRgn(); oldMBarHeight = LMGetMBarHeight(); LMSetMBarHeight(0); /* make the Menu Bar's height zero */ SetRect(&mBarRect, qd.screenBits.bounds.left, qd.screenBits.bounds.top, qd.screenBits.bounds.right, qd.screenBits.bounds.top + oldMBarHeight); mBarRgn = NewRgn(); RectRgn(mBarRgn, &mBarRect); UnionRgn(gray, mBarRgn,gray);/* tell the desktop it covers the menu * bar */ PaintOne(nil, mBarRgn); /* redraw desktop */ } void ShowMenuBar() { RgnHandle gray; gray = LMGetGrayRgn(); LMSetMBarHeight(oldMBarHeight); /* make the menu bar's height normal */ DiffRgn(gray, mBarRgn,gray); /* remove the menu bar from the * desktop */ DisposeRgn(mBarRgn); } main() { Init(); HideMenuBar(); while (!Button()) ; ShowMenuBar(); } -- Paul Baxter paulba19@idt.net =================================================================== || || || ----- || || / \ || || | | The Application "Programmer" has unexpectedly || || \ / quit. An error of type "AM occured. || || ----- || || || || ---- || || ( ok ) || || ---- || || || ===================================================================