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, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: GTK and tasking (GNAT) Date: Mon, 5 May 2014 09:33:46 +0200 Organization: cbb software GmbH Message-ID: <4cd15djcr82g$.1kb4o3rixd5oo$.dlg@40tude.net> References: <1db3ntu987ypk$.6zu9ghm9azm0.dlg@40tude.net> <14ydfwlh6wfe4$.1rv26jm958z.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: G+aXx1XI67D34t54ibhUPQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:19679 Date: 2014-05-05T09:33:46+02:00 List-Id: On Sun, 04 May 2014 18:32:45 -0300, hreba wrote: > I am talking about calculations that can be broken down, as in my > example at the beginning of this thread: I count from 1 to 10, update a > text box and call delay at each iteration, but the display changes only > after the termination of the loop. You can find an example of how to do this in GtkAda here: http://www.dmitry-kazakov.de/ada/aicwl.htm#12.6 The example performs a very lengthy calculation in an independent task and among other updates a progress bar. The method is still the one I described. http://www.dmitry-kazakov.de/ada/gtkada_contributions.htm#1 You post data (e.g. the bar position) to the main loop from where the action is performed. So the plotter in the example is based on this technique as well. Its refresh engine, which periodically updates the curves, is an Ada task that posts Queue_Draw to the main loop. There is no simple way of doing tasking in GUI. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de