treeview how to make search function
- From: Chris De Maeyer <chrisdm pandora be>
- To: gtk-app-devel-list gnome org
- Subject: treeview how to make search function
- Date: Sat, 26 Jun 2004 16:14:10 +0200
How do i implement the treeview searchable functionality?
Currently i have following code, but doesn't work:
store = gtk_tree_store_new (N_COLUMNS,G_TYPE_STRING,G_TYPE_STRING);
FillAirports(store);
tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
g_object_unref (G_OBJECT (store));
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Location",
renderer, "text", NAME_COLUMN,NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
column = gtk_tree_view_column_new_with_attributes ("ID", renderer,
"text", ID_COLUMN,NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
gtk_tree_view_set_enable_search(GTK_TREE_VIEW (tree),TRUE);
gtk_tree_view_set_search_column(GTK_TREE_VIEW (tree),0);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
gtk_box_pack_start(GTK_BOX(hboxa0), scrolled_window, TRUE, TRUE, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]