【Gtkmm4】How to draw a specified widget in parent implement snapshot_vfunc?

Want to draw some of the children of parent.
I try to use snapshot_child, but it tips the warning here, what’s wrong with me?

I call the a.snapshot_vfunc in parent snapshot_vfunc , but it is a protected function.(It’s public in vala)

And what are you doing there?

GtkListBox manages child widgets in a very specific way, and already draws them properly. You added a GtkLabel directly, but the listbox doesn’t add itself as a parent, but an intermediate widget (read the docs and check for GtkListBoxRow).

1 Like

Gotcha the issue
Thank you for your tips!

And I want to drag and drop the sub-item.
Cause the default ListBox or ListView or TreeView’s DND is abnormal in Window.
So I have to customize this by myself

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.