Commit 8b118eb8 authored by Benjamin Otte's avatar Benjamin Otte

gtk-demo: Make icon counter work from ui file

Gets rid of update always being 1 frame late.
parent dd406c80
......@@ -70,8 +70,7 @@ do_stats (GtkWidget *widget,
n_frames += stats->frame_counter[i];
}
new_label = g_strdup_printf ("%u icons - %.1f fps",
stats->item_counter[stats->stats_index],
new_label = g_strdup_printf ("icons - %.1f fps",
(double) G_USEC_PER_SEC * n_frames
/ (N_STATS * STATS_UPDATE_TIME));
gtk_label_set_label (GTK_LABEL (info_label), new_label);
......
......@@ -10,7 +10,16 @@
<child>
<object class="GtkLabel" id="info_label">
<property name="visible">True</property>
<property name="label">0 fish - 0 fps</property>
<property name="label">icons - 0 fps</property>
</object>
<packing>
<property name="pack_type">end</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="label" bind-source="bowl" bind-property="count">0</property>
</object>
<packing>
<property name="pack_type">end</property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment