From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,STOX_REPLY_TYPE, STOX_REPLY_TYPE_WITHOUT_QUOTES,XPRIO autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!newsfeed.tele2net.at!news.panservice.it!feed.xsnews.nl!border02.ams.xsnews.nl!feeder02.ams.xsnews.nl!frontend-F10-13.ams.news.kpn.nl From: "ldries46" Newsgroups: comp.lang.ada Subject: Mouse Clicks in a Drawing Area Date: Tue, 4 Feb 2014 07:46:51 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 15.4.3555.308 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 Message-ID: <52f08d46$0$9122$703f8584@news.kpn.nl> Organization: KPN.com NNTP-Posting-Host: 77.168.179.107 X-Trace: 1391496518 news.kpn.nl 9122 77.168.179.107@kpn/77.168.179.107:52776 Xref: number.nntp.dca.giganews.com comp.lang.ada:184643 Date: 2014-02-04T07:46:51+01:00 List-Id: I do want to draw something at a certain point in a Drawing_Area. That point should be derived from a mouse click. To do this I have created a handler "On Button_Press". I already have a draw event connected that works. I have concluded this from the facts I can see and from the breakpoint I positioned inside the "On_Area_Draw" Handler. The mouse click handler is created analog to the Draw handler. After creating the Drawing Area "Sudoku_Area" the handlers are initiated as follows: Add_Events(Sudoku_Area, BUTTON_PRESS_MASK); CR := Create(Get_Window (Sudoku_Area)); Event_Cb.Connect (Sudoku_Area, "draw", Event_Cb.To_Marshaller (On_Area_Draw'Unrestricted_Access)); Event_Cb.Connect (Sudoku_Area, "button_press_event", Event_Cb.To_Marshaller (On_Button_Press'Unrestricted_Access)); where: package Event_Cb is new Gtk.Handlers.Return_Callback (Gtk_Drawing_Area_Record, Boolean); The compilation of this is faultless. I do use the following handlers: function On_Area_Draw (Object : access Gtk_Drawing_Area_Record'Class; Context : Cairo.Cairo_Context) return boolean; function On_Button_Press (Object : access Gtk_Drawing_Area_Record'Class; event : Gdk_Event) return boolean; Both program build faultless. I put a breakpoint inside the On_Button_Press function at a point where it should always be reached. Running the program and clicking within the drawn area that breakpoint is never reached and the program runs without reporting an error. I am using Gtk 3.4 and GPS. What do I do wrong?