[comp.sys.mac.programmer] PopUpMenu angst with the THINK Class Library

nick@cs.edinburgh.ac.uk (Nick Rothwell) (10/15/90)

Has anybody tried to get popup menus working in a TCL application? I've
tried and failed. I have an old non-TCL application (TransSkel based, in
fact) which has panels (dialog user-items) that produce pop-ups. This
works fine; I install the menu into the menu bar (with a hierMenu flag),
and call PopUpMenuSelect() with global coordinates when the mouse goes
down. No problem. Now I try to do the same in my TCL application, from
a CPane's DoClick() method (or a callee thereof). No joy: PopUpMenuSelect()
returns immediately with a result of 0. I've tried various things (like
installing the popup menu with the Bartender vs. doing it myself) - no
difference.

I had a go at popping up a menu in the demo Starter application, just in
case it was some interaction with other parts of my application. Again,
no joy.

So, I'm stuck. PopUpMenuSelect() is too simple to go wrong...! I can only
guess that the TCL is interfering somehow, by altering the event queue
(although StillDown() returns true before the PopUp call), or interfering
with the GrafPort, or with the menu (the enableFlags are fine, but I
notice in the debugger that the width and height fields are sometimes -1,
although a call to CalcMenuSize() before the PopUp doesn't help).

Anybody got any ideas?

		Nick.

-- 
Nick Rothwell,	Laboratory for Foundations of Computer Science, Edinburgh.
		nick@lfcs.ed.ac.uk    <Atlantic Ocean>!mcsun!ukc!lfcs!nick
~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~
 "Now remember - and this is most important - you must think in Russian."