I am lookng for a way of rendering some gtk widget container to pixbuf for later use in drag'n'drop icon image using gtkmm3.
The correct way in native gtk3 to do this is, as far i researched, - usage of gtk_widget_draw() on supplied cairo surface.
The creation of this surface is not an issue, however the call to gtk_widget_draw() itself is.
Only place where it mentioned directly in gtkmm-3.4.2 sources is Gtk::Widget::draw() function (widget.cc:310), which is declared as `protected'.
So my question is: how do i properly perform such task (rendering widget to pixbuf) in gtkmm3?
At this point i see two options:
Subclass Gtk::Widget to provide public interface to protected draw() function
Extract gobj* instance from Gtk::Widget and call native Gtk's gtk_widget_draw() on this instance.
The question is: which way is preferable and why? Or maybe there are some other [better] ways to do it?