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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.7.228 with SMTP id m4mr4630801paa.47.1461743220674; Wed, 27 Apr 2016 00:47:00 -0700 (PDT) X-Received: by 10.157.45.79 with SMTP id v73mr82011ota.9.1461743220524; Wed, 27 Apr 2016 00:47:00 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!g8no7316877igr.0!news-out.google.com!k10ni46igv.0!nntp.google.com!g8no7316869igr.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 27 Apr 2016 00:47:00 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=194.98.77.125; posting-account=6yLzewoAAABoisbSsCJH1SPMc9UrfXBH NNTP-Posting-Host: 194.98.77.125 References: <0a9cf35e-45ba-49c1-9d6a-4a0da3457e70@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <31e4394b-eb85-4d31-bd25-f2bd332c7c9b@googlegroups.com> Subject: Re: Where do I get my Cairo context from (in GTK3)? From: briot.emmanuel@gmail.com Injection-Date: Wed, 27 Apr 2016 07:47:00 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:30299 Date: 2016-04-27T00:47:00-07:00 List-Id: > I would use On_* procedures if I didn't need user data. Until now no > success. Are you sure you really need that user data ? In my experience, it is often better to extend the widget type in your application, store whatever information is needed in that child type, and then use the On_* procedure passing a Slot object (so that the callback receives your widget type, rather than the widget on which the action occurred). This works in 95% of the cases. The GNAT Development Studio (GPS), which is about 500_000 lines of code has almost no use of user data, and those that remain are mostly because that part of the code hasn't been updated yet.