Re: Scrolling to a GtkListBoxRow after adding it to a GtkListBox
- From: cecashon aol com
- To: mike vee net, gtk-app-devel-list gnome org, postiffm comcast net
- Subject: Re: Scrolling to a GtkListBoxRow after adding it to a GtkListBox
- Date: Sun, 15 Apr 2018 17:43:22 -0400
"
Is the issue that the widget is not yet drawn, so it size is not settled yet?
Total guesses: What about using g_signal_connect_after on size-allocate? Or connecting to map-event signal on
that widget? Or spinning on gtk_events_pending() until all are done, then scroll down?
"
Hi Matthew
Good ideas. A quick check on the events pending works. The g_signal_connect or g_signal_connect_after is
probably a better way to go.
Eric
'''
GtkWidget *row=create_row(text);
gtk_list_box_insert(GTK_LIST_BOX(list_box), row, -1);
gtk_widget_show_all(row);
while (gtk_events_pending()) gtk_main_iteration();
gtk_list_box_select_row(GTK_LIST_BOX(list_box), GTK_LIST_BOX_ROW(row));
GtkAdjustment *adj=gtk_list_box_get_adjustment(GTK_LIST_BOX(list_box));
gdouble upper=gtk_adjustment_get_upper(adj);
gtk_adjustment_set_value(adj, upper);
'''
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]