From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Date: Fri, 21 Oct 2022 13:46:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: Is this an Gtk issue or an Ada issue or even a OS issue? Unwanted parallel processing Newsgroups: comp.lang.ada References: <877d0wq590.fsf@samuel> Content-Language: en-GB From: ldries46 In-Reply-To: <877d0wq590.fsf@samuel> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Organization: KPN B.V. Path: eternal-september.org!reader01.eternal-september.org!feeder1.feed.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr2.eu1.usenetexpress.com!94.232.112.244.MISMATCH!feed.abavia.com!abe004.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail Injection-Date: Fri, 21 Oct 2022 13:46:11 +0200 Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com" Xref: reader01.eternal-september.org comp.lang.ada:64527 List-Id: Op 18-10-2022 om 21:52 schreef Ludovic Brenta: > ldries46 writes: > >> I have the following problem, which I can solve in my case but I still >> want to know how to solve in a general way. >> Case: >> In an Ada program I use the Gtk Filechooser with the On_OK routine. In >> that routine I read the chosen file and start some other calculations >> I need to do on that file (call for a new dialogue witin a callback >> from a higher level).  But these calculations are depending on the >> extension of the file. In some cases I even need another dialogue to >> decide which type o f calculations I have to follow. The program can >> only go on after this manual choice is made. But I see that the >> program goes on without waiting on that last dialogue to be closed. >> Is there a way in Gtk to solve this or in Ada to block that obvious >> parallel processing or must I look for a solution within the operating >> system (Windows 11) > I'm not sure what goes on "in parallel". Have you started any tasks in > your Ada program? > > If you want a modal dialog, you run it with Gtk.Dialog.Run, which starts > a nested event loop and does not process inputs in any other parts of > the GUI until the user closes this dialog causing Run to return. Of > course, since you've read the documentation on Gtk.Dialog, I assume this > is how you open your dialog. So, what is your problem exactly? > I have started my dialog with de show_all function. In this case the radio buttons and OK button do work correctly with show they did not work and with run they did not even appear in the dialog. I understand in the mean time that show and show all makes the program not stopping until the the dialog is completed and run stops the further running of the program until the dialog is stopped. Now I just need the run equivalent of show_all