How can I update text in a GtkWidget once it's been attached to a grid?

As stated in the title, I am trying to update my GtkWidget after it has been attached to a grid. I am trying to update integer values in real-time (once every second or so), and haven’t been able to get a very efficient way of doing it.

My current code runs a bit like this:

While true
get new values, create label with mnemonics using said values, attach label, wait for 1 second, remove label.

I am looking to make this more efficient since I get a LOT of warning and critical messages when running things like this, thank you for any help!

On a separate point, if anyone knows a good source for Gtk4 tutorials please let me know, I can’t really find anything of use out there.
Thank you!

There is no way to find the cause of errors/warnings you are facing without looking at the code.

And for tutorials you have

GTK4/LibAdwaita
https://developer.gnome.org/documentation
https://gnome.pages.gitlab.gnome.org/gtkmm-documentation

GTK3
https://developer-old.gnome.org/gtkmm-tutorial/3.24

In case you didn’t know, https://docs.gtk.org exists. And also, Devhelp.

1 Like

A decent GTK4 tutorial GTK 4 tutorial
You should put some of your code here and also those warning messages you got, so people (not me who is also a beginner with GTK development). It’s true that access to accurate documentation for your context is crucial.
At first I wanted to do my project in C++ or why not start learning Rust, but as it would involved to use bindings and harder access to documentation, I finally choose make a C project, but even doing so I needed to deal with libraries updates and deprecations it involved.

1 Like