Why no gtkmm equivalent for gtk_list_store_set?
- From: Jef Driesen <jefdriesen hotmail com>
- To: gtkmm-list gnome org
- Subject: Why no gtkmm equivalent for gtk_list_store_set?
- Date: Thu, 26 Jul 2007 12:07:51 +0200
Is there a reason why there is no equivalent gtkmm function for
gtk_list_store_set? Because changing multiple columns at once is really
MUCH faster than changing one column at a time.
In my application I noticed a speed difference of 75 times (1500ms vs
20ms)! The treeview model has 11 columns and around 850 rows, and I'm
using this piece of code to fill the model (from an sqlite database):
clock_t start = clock ();
while (cmd.step()) {
// USING GTKMM FUNCTIONS
Gtk::TreeModel::Row row = *(store->append());
row[m_columns.number] = cmd.column_int(0);
row[m_columns.datetime] = cmd.column_text(1);
// other columns here
// USING GTK+ FUNCTIONS
GtkTreeIter iter;
gtk_list_store_append(GTK_LIST_STORE(store->gobj()),&iter);
gtk_list_store_set(GTK_LIST_STORE(store->gobj()),&iter,
m_columns.m_number.index(), cmd.column_int(0),
m_columns.m_datetime.index(), cmd.column_text(1),
// other columns here
-1
);
}
clock_t finish = clock ();
double duration = (double)(finish - start) / CLOCKS_PER_SEC);
printf("Time: %f ms\n", 1000.0 * duration);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]