Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cs.utexas.edu!wuarchive!ukma!rutgers!cbmvax!cbmehq!cbmdeo!jsmami!jsmoller From: jsmoller@jsmami.UUCP (Jesper Steen Moller) Newsgroups: comp.sys.amiga.programmer Subject: Re: How to use BPLCON2? Message-ID: <18b0f01f.ARN04048@jsmami.UUCP> Date: 16 Feb 91 12:09:51 GMT References: <12181@helios.TAMU.EDU> Reply-To: cbmvax!cbmehq!cbmdeo!jsmami!jsmoller Followup-To: comp.sys.amiga.programmer Organization: Danish SofTech Lines: 54 In article <12181@helios.TAMU.EDU>, Aaron Hightower writes: > Today, I was working on one of my programs that uses both sprites and menus > on the same screen. The problem that I ran into was when I tried to use the > menus. When the menu is pulled down, the sprite(s) overlap the menu. > [hardware stuff deleted] > > The other thing that I tried (first) was to read the MENUBUTTON, MENUDOWN > event from my IDCMP port, but since Intuition evidently processes the right > button for the menus, it is not accessible (is absorbed and not passed > through the IDCMP port.) It mentioned that you could do a RMBTRAP, but that > this would temporarily disable the menu. You are on the right track: Use the IDCMP-code MENUVERIFY. You will get this message when the user presses the right mouse button. When you recieve the message, remove the sprites. Then when you recieve MENUPICK, put the sprites back in place. WARNING: Do not use any funtion that calls a DOS function or put up a requester or whatever, without turning the MENUVERIFY off. Otherwise, you get a ever- so popular Intuition deadlock. Intuition waiting for you to reply to MENUVERIFY, user trying to answer the requester, but fails, because he/she pressed the right button, and Intuition can't do anything. So, to make it all work without errors: ModifyIDCMP(window,SAFEIDCMP Where SAFEIDCMP has _no_ xxxxVERIFY flags. BEFORE caling any AutoRequesters, EasyRequests (2.0), DOS calls, or things like: OpenDiskFont, OpenDevice, OpenLibrary, AvailFonts, etc. - these functions call DOS routines, and there you go. Whack! Mouse freezes if MENUBUTTON is pressed. If this is too dull, I'm sure the Commodore folks will add comments, if I have missed anything vital. I use this technique in my IFFMaster 1.0 (an IFF-converter that handles many things, totally interactively and system-friendly) and if I'm not mistaken, that's how DPaint does. > Mucho gracious, > Aaron Hightower Nothing, really :) Jesper S Moller (Denmark) -- __ Jesper Steen Moller /// VOICE: +45 31 62 46 45 Maglemosevej 52 __ /// USENET: cbmehq!cbmdeo!jsmami!jsmoller DK-2920 Charl \\\/// FIDONET: 2:231/84.45 Denmark \XX/ OPINIONS: Certainly!