In GTK4, Do I have to extend widget class to draw something?

I want to implement my own visual widget, which does not require advanced control - just some custom rendering. It seems like in GTK4, the draw signal is removed.
Is there any other way to render my own stuff than extending widget class?
In the language binding I am using, extending gtk widget class to make my own widget is quite hard - That is, I likely need to write c code to create that widget specifically. I want to avoid that if possible.
Is there any other way? Thanks in advance!

If you want to draw with Cairo, you can use GtkDrawingArea without subclassing.

If you want to write your own custom widget and use the snapshot API, then: yes, you need to derive from GtkWidget.

1 Like