Gtk-CRITICAL error when using gtk_text_view_scroll_to_mark
I kept getting Gtk-CRITICAL...: gtk_some_function: assertion 'GTK_IS_WIDGET (widget)' failed and similar errors when running my program.
I found the problem was gtk_text_view_scroll_to_mark
was being called on a text area in a notebook tab, but that text area had not yet been viewed so it had not been realized. It is interesting that scroll_to_mark doesn't check for this first, should it? This behavior was surprising and not documented.
I'm using PoP!_OS 18.04 (Ubuntu 18.04) with GNOME 3.28.2.
I was able to work around it by guarding my call to scroll to mark with call to gtk_widget_get_realized
.
Edited by Ghost User