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=-1.9 required=3.0 tests=BAYES_00,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Is this an Gtk issue or an Ada issue or even a OS issue? Unwanted parallel processing Date: Tue, 18 Oct 2022 21:52:11 +0200 Organization: A noiseless patient Spider Message-ID: <877d0wq590.fsf@samuel> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: reader01.eternal-september.org; posting-host="e05fa20ad8fc53594b0e360c67ba716a"; logging-data="4004973"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19U9cSA8m1TQ8yLftY60KoI" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:jNvwRd3MEmm8SeMCwKY1Jdw52hg= sha1:okt9zBK4DrTjVWJMN2UkhBEtZmc= Xref: reader01.eternal-september.org comp.lang.ada:64522 List-Id: 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? -- Ludovic Brenta. The Managing Principal Vice Co-Director of Business Operations re-aggregates long-range co-innovations.