Submenus in popupclick are hyperactive


Placing a procedure with a popupclick statement containing submenus in an object like a button or shape, when an item is selected from a submenu the main popup menu immediately re-opens at the exact location of the click on the submenu. To stop this behaviour, you have to click outside the re-opened menu, and then the item which was clicked in the submenu is returned. If you click again inside the menu the behaviour is repeated over and over until the re-opening menus run out of the form window.

In other words, the popupclick statement seems to be repeating over and over until the screen outside of the menu is clicked.

This is quite hard to describe clearly. Would a couple of screenshots be helpful?

David Duncan


In sheer frustration I’ve given up with popupclick and used regular popup menu button objects.

However, for the record here’s the popupclick procedure code which exhibits the endless menu rotation when placed in the procedure panel of a push button or other object (but not in the popup menu button):

fileglobal fRunsPUMchoice

submenu("DC bookings")+
menuitem("Open bookings window","CODE","")+
menuitem("Print bookings calendar","CODE","")+
menuitem("Enter a manual booking","CODE","")+
submenu("Truck bookings")+
menuitem("Make a truck booking")+
menuitem("Re-send a truck booking")+
menuitem("Cancel a truck booking")+
menuitem("DC bookings…","SUBMENU","DC bookings")+
menuitem("Truck bookings…","SUBMENU","Truck bookings"),

message info("trigger") 
message fRunsPUMchoice

David Duncan


Thanks for posting this code. Here’s a screen shot of it in operation on my computer:

(The purple backdrop is just because the test form I had handy was that color.)

I was able to duplicate the problem you describe, though it’s not obvious from this screen shot.

Using submenus with popupclick is not documented to work, and could not be done in Panorama 6. However, it would certainly be nice if it did work. I have submitted a bug report for this, but I may not get around to fixing it for a while.


I was able to modify that behaviour by putting a statement like stop or rtn or call in the “CODE” parameter of the menuitem( defining a submenu item. But it’s clearly not ideal to have to do that.


I’d be interested in seeing the exact code you used to modify the behavior. I wasn’t able to get it to work no matter what code I put in. This statement simply wasn’t designed to work with submenus. If it was, it would have some way to return the value of both the selected menu and the submenu (in case multiple submenus had the same item). There is simply no code in their for doing that (yet).


I’ve obviously misled you into thinking I’d claimed to fix the problem in saying that I’d modified the behaviour. In fact by putting a statement like stop in the “CODE” parameter of the menuitem( defining a submenu item, it comes up with an error message instead of the cascading menus. The message is Field or variable "popUserChoice" does not exist.

Sorry. I’ll try and be clearer in future.