Hi everyone,
that’s about positioning GtkRevealer child with in GtkOvelay at some custom position:
is there any function in user space that indicate necessity for gtk_widget_measure()
calls?
(something like gtk_widget_get_resize_needed()
)
example of code with that:
g_signal_connect(overlay, "get-child-position", G_CALLBACK(nt_legend_pos_cb), nt);
...
static gboolean nt_legend_pos_cb(GtkOverlay *overlay, GtkWidget *widget, GdkRectangle *r, t_notifier *nt) {
if (GTK_IS_OVERLAY(overlay) && r && nt) {
if (GTK_IS_WIDGET(widget) /* && gtk_widget_get_resize_needed(widget) */) {
int unused;
gtk_widget_measure(widget, GTK_ORIENTATION_HORIZONTAL, -1, &unused, NULL, NULL, NULL);
gtk_widget_measure(widget, GTK_ORIENTATION_VERTICAL, -1, &unused, NULL, NULL, NULL);
}
r->x = nt->x; r->y = nt->y;
return true;
}
return false;
}