• Is this an Gtk issue or an Ada issue or even a OS issue? Unwanted paral

    From ldries46@21:1/5 to All on Tue Oct 18 08:30:34 2022
    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)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ludovic Brenta@21:1/5 to bertus.dries@planet.nl on Tue Oct 18 21:52:11 2022
    ldries46 <bertus.dries@planet.nl> 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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From ldries46@21:1/5 to All on Fri Oct 21 13:46:06 2022
    Op 18-10-2022 om 21:52 schreef Ludovic Brenta:
    ldries46 <bertus.dries@planet.nl> 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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ludovic Brenta@21:1/5 to bertus.dries@planet.nl on Sat Oct 22 01:26:28 2022
    ldries46 <bertus.dries@planet.nl> writes:
    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

    From gtk-dialog.ads:
    -- Before entering the recursive main loop, Gtk.Dialog.Run calls
    -- Gtk.Widget.Show on the dialog for you. Note that you still need to show
    -- any children of the dialog yourself.

    Gtk_Dialog_Record is a type extension of Gtk_Window_Record, which is a
    type extension of Gtk_Bin_Record, so your Gtk_Dialog has a single child,
    which you need to show (this child is the VBox described in the
    documentation of Gtk_Dialog).

    Therefore:
    - call Gtk.Dialog.Gtk_New (D).
    - Create your widgets, pack them into D.Get_Content_Area
    - Create and pack any buttons (e.g. OK, Cancel, Help) into D.Get_Action_Area.
    - call D.Get_Child.Show_All;
    - call D.Run

    --
    Ludovic Brenta.
    Our quest for quality will be best positioned to boost a resourceful, parallel and granular pre-plan.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)