[PYTHONMAC-SIG] Full Screen Window

Michael Diehr mike@xochi.com
Tue, 28 Jan 1997 10:21:50 -0700


You need to turn off the menu bar as well... here's some sample code I
wrote that also handles the Control Strip as well...



RgnHandle	gMyMBarRgn = NULL;
short		gOldMBarH;
Boolean 	controlStripHidden = false;

void Hide(void)
{
//	short		oldH;
//	RgnHandle	MyMBarRgn=NewRgn();			//new region
	Rect		MyMBarRect;
	long		gestaltInfo;
// Try to hide control strip  controlstip.h gestalt.h
	if (Gestalt(gestaltControlStripAttr,&gestaltInfo) == noErr)
	{
		if (SBIsControlStripVisible())
		{
			SBShowHideControlStrip(false);
			controlStripHidden = true;
		}
	}

	gMyMBarRgn=NewRgn();			//new region

	gOldMBarH=LMGetMBarHeight();
	LMSetMBarHeight(0);
	DrawMenuBar();
	MyMBarRect=qd.screenBits.bounds;
	MyMBarRect.bottom=qd.screenBits.bounds.top+gOldMBarH;
	RectRgn(gMyMBarRgn,&MyMBarRect);
	UnionRgn(LMGetGrayRgn(),gMyMBarRgn,LMGetGrayRgn());
	PaintOne(NULL,LMGetGrayRgn());

}

void Show(void)
{
	long		gestaltInfo;
	if (gMyMBarRgn)
	{
		DiffRgn(LMGetGrayRgn(),gMyMBarRgn,LMGetGrayRgn());
	//restore initial Rgn
		DisposeRgn(gMyMBarRgn);
		gMyMBarRgn = NULL;
		LMSetMBarHeight(gOldMBarH);
		DrawMenuBar();
		PaintOne(NULL,LMGetGrayRgn());

		if (Gestalt(gestaltControlStripAttr,&gestaltInfo) == noErr)
		{

			if (controlStripHidden)
			{
				SBShowHideControlStrip(true);
				controlStripHidden = false;
			}
		}

	}
}


--
Michael Diehr                   E-mail      : mailto:mike@xochi.com
Xochi Media                     WWW         : http://www.xochi.com/mike
510 Stratford Ct #210A          Direct Line : +1.619.481.2238
Del Mar CA 92014-2740           Fax         : +1.619.481.9487



_______________
PYTHONMAC-SIG  - SIG on Python for the Apple Macintosh

send messages to: pythonmac-sig@python.org
administrivia to: pythonmac-sig-request@python.org
_______________