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 autolearn=unavailable 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!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: hreba Newsgroups: comp.lang.ada Subject: Re: GTK and tasking (GNAT) Date: Sun, 04 May 2014 15:36:55 -0300 Message-ID: References: <1db3ntu987ypk$.6zu9ghm9azm0.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 9uogtSFoeliD2xoLRSYB6AP3YCLm3K7QkjVqDpYmy7hlESCd/R Cancel-Lock: sha1:fSvmKCxnd6ZkkZjJBYP6Ch1Ogl8= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 In-Reply-To: <1db3ntu987ypk$.6zu9ghm9azm0.dlg@40tude.net> Xref: news.eternal-september.org comp.lang.ada:19663 Date: 2014-05-04T15:36:55-03:00 List-Id: On 05/04/2014 04:31 AM, Dmitry A. Kazakov wrote: > On Sat, 03 May 2014 17:30:08 -0300, hreba wrote: > >> Can somebody tell me what is wrong and how to do it right? > > 1. Gtk is not task-safe, which also includes Glib, Cairo etc. > > 2. Gtk are synchronous calls, when performed between tasks this may lead to > deadlocking even in a task-safe environment, which Gtk is not. > > If you want to call to Gtk operations from an independent Ada task you must > marshal it to the main task (the task running Gtk messages loop). An > implementation of this mechanism is here: > > http://www.dmitry-kazakov.de/ada/gtkada_contributions.htm#1 > Is 'task-safe' more or less the same as 'thread-safe'? I have a little experience with GTK programming using Oberon, which doesn't contain a task concept on the language level. I am somewhat disappointed about the details you have to understand about GTK and tasking in order to use a GUI in an Ada program. Given that what I want is - libraries available on Linux and Windows (as GTK) - a GUI builder for the layout (as Glade) - no fancy things, but: * buttons * text boxes * drawing areas * keyboard, mouse click and mouse movement events - basic tasking: life output (progress) during lengthy calculations What GUI library would you recommend? I would be happy and grateful to use your GtkAda contributions, I just want to be sure to use more or less common software. Thanks for your answer. -- Frank Hrebabetzky +55 / 48 / 3235 1106 Florianopolis, Brazil