GTK 4.0
GTK 4.0
Posted Dec 17, 2020 11:56 UTC (Thu) by alexl (guest, #19068)In reply to: GTK 4.0 by mchehab
Parent article: GTK 4.0
Of course, with Gtk 4 you ideally don't want to use cairo to draw at all as it is really the old "fallback" software rendering codepath.
The modern way to draw is to implement snapshot and create render nodes which will avoid any cairo work and just do OpenGL rendering.
However snapshot is kind of lowlevel. Its used if you want to do some custom specialized rendering. If you just want to render an image in your UI, just put the pixbuf in a in a GtkPicture subwindow. One of the nice advantages of Gtk4 is that everything, even sub-parts of widgets are just widgets. You very rarely have to have a custom drawing function that draws multiple things.
