From: "Mars" Sender: "Mars" Reply-To: "Mars" Subject: Help => OOP: Programming a mouselistener Newsgroups: comp.os.msdos.djgpp NNTP-Posting-Host: proxy.orbit.net.mt Message-ID: <36055909.0@news.orbit.net.mt> Date: 20 Sep 1998 21:35:37 +0100 Lines: 16 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Having used Java this summer, I wish to write a MouseListener for C++. The buttons are objects derived from a basic class. I have written another class which contains these buttons, and given an x and y coordinate it checks to see if any button registered with it falls onto these coordinates. If it does, appropriate action is taken. My problem is that I need to call this class whenever the user clicks the mouse. Using Allegro, you have to rewrite the mouse_callback function, which is called during a mouse interrupt, This entails the locking of all buttons and classes which is not feasable. Therefore, can anyone point for me some information on how I can overcome this problem? I would appreciate if someone can give me a site where the algorithms of such programs are explained. Thanks Mars