🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #24271

Re: Menus on the title bar.

#24271
From: David W. Berry
Date: Fri, 22 Jan 1988 20:05
50 lines
2253 bytes
In article <1514@phoenix.Princeton.EDU> buzz@phoenix (Mahboud Zabetian) writes:
>
>Does anyone know what the best way is to make a popup menu when you
>option-click on the title bar of a window?  I seem to recall having seen it
>before.
>
>One way to do that is to fool the mac into thinking that the click is in the
>menu bar, and having the menu manager handle the event.  But I don't want to 
>do it that way since each window will have its own unique menu.(plus the
>standard ones in the menu bar).
>
>Any help will be appreciated.
	Presuming your an application and not a desk accessory you should
have something like the following:

	switch(event.what)
	{
	....
	case mouseDown:
		switch(FindWindow(&event.where, &window))
		{
		...
		case	inDrag:

Change what normally comes after inDrag, to test the modifiers
bits and call PopUpMenu (a new trap, test for it's existence as
in some tech note or other) if the option key is down, otherwise
handle inDrag as normal.

	Remember that option-click in the title bar isn't something
defined by the UI guidelines, so you will have to prominently
document it (ie., don't bury it in the manual, nobody reads it
anyway) or people won't know whatever feature you implement that
way exists.

	If you're a DA it gets a lot harder because the system
handles the clicks in your drag region (ie., the title bar)
>-- 
>Mahboud Zabetian				buzz@phoenix.princeton.edu
>183 Little Hall 					(609) 520-1271
>Princeton University, Princeton, NJ 08544		(609) 734-7760
>****** Anyone need a soon-to-graduate hardware/software engineer? ********


-- 
	David W. Berry
	dwb@well.uucp                   dwb@Delphi
	dwb@apple.com                   973-5168@408.MaBell
Disclaimer: Apple doesn't even know I have an opinion and certainly
	wouldn't want if they did.
Technical Details
Message-ID: <7249@apple.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!pasteur!ucbvax!hplabs!pyramid!voder!apple!dwb
References: <1514@phoenix.Princeton.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!pasteur!ucbvax!hplabs!pyramid!voder!apple!dwb
From: dwb@apple.UUCP (David W. Berry)
Newsgroups: comp.sys.mac
Subject: Re: Menus on the title bar.
Message-ID: <7249@apple.UUCP>
Date: 22 Jan 88 20:05:07 GMT
References: <1514@phoenix.Princeton.EDU>
Reply-To: dwb@apple.UUCP (David W. Berry)
Organization: Apple Computer Inc., Cupertino, USA
Lines: 50