1

I don’t have a lot of hope for this but anyway.

I need to create a widget to select a range (like a scale widget but with two cursors, one for the lower bound and another for the upper bound). This needs to be built "from scratch". According to the Gtkada documentation, I just have to take a look at the gtkdial example (gtkdial seems to be the classic example for gtk to build widget from scratch).

The example is clearly out of date, a lot of functions, packages and events don’t exist anymore.

For example Gtk.Widget.Realize_Handling is gone (instead we have on_Realize I think), the function Get_Count doesn’t exist as the event "size_request"… I tried to do it on my own by reading and understanding the source code, but I’ m still a beginner with GTK.

Do you know if an up-to-date version of this example exists?

Louis Etienne
  • 1,302
  • 3
  • 20
  • 37
  • 2
    If the example is using GtkAda 2, and you are using GtkAda 3, this resource might help you, although at first sight, there's no reference to the entities you're mentioning. https://docs.adacore.com/live/wave/gtkada/html/gtkada_ug/transition.html For other examples of GtkAda, see dependents of the gtkada crate: https://alire.ada.dev/crates/gtkada, or mentions of gtkada in the awesome-ada list: https://github.com/ohenley/awesome-ada – Gneuromante Aug 12 '23 at 11:07
  • 2
    I don't know a lot about GtkAda but in the past I looked at the current c++/c examples to see how to do it and then look for the corresponding Ada code translations to those. Aside from that, there is Dmitry who maintains some extensions to Gtk so he might be knowledgeable on the topic. His page has his contact info ( http://www.dmitry-kazakov.de/ada/gtkada_contributions.htm ) and he is a common person on comp.lang.ada (unfortunately has a lot of spam though..NSFW). You might poke him and see if he has any resources or suggestions – Jere Aug 12 '23 at 16:17
  • 2
    Side question: Have you tried just overriding one of the On_Realize procedures in your new widget? You need to remember to call the base version at the end of your overridden version or it won't work completely. This is where it is declared: https://github.com/AdaCore/gtkada/blob/b17054b92338d22db46ea0e2c63037b3e50190da/src/generated/gtk-widget.ads#L5087 – Jere Aug 12 '23 at 16:23

0 Answers0