2 #include "ephy-completion-model.h"
6 main (int argc
, char **argv
)
11 EphyCompletionModel
*cModel
;
13 GtkCellRenderer
*renderer
;
14 GtkTreeViewColumn
*column
;
18 gtk_init (&argc
, &argv
);
21 eh
= ephy_history_new ();
22 cModel
= ephy_completion_model_new (eh
);
23 model
= GTK_TREE_MODEL (cModel
);
25 g_print ("Number of entries = %d\n",
26 gtk_tree_model_iter_n_children (model
, NULL
));
29 window
= gtk_window_new (GTK_WINDOW_TOPLEVEL
);
30 gtk_window_set_default_size (GTK_WINDOW (window
), 800, 600);
31 g_signal_connect (window
, "destroy", G_CALLBACK (gtk_main_quit
),
34 scrwin
= gtk_scrolled_window_new (NULL
, NULL
);
35 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrwin
),
37 GTK_POLICY_AUTOMATIC
);
38 gtk_container_add (GTK_CONTAINER (window
), scrwin
);
40 treeview
= gtk_tree_view_new_with_model (model
);
41 g_object_unref (model
);
42 renderer
= gtk_cell_renderer_text_new ();
43 g_object_set (renderer
, "ellipsize", PANGO_ELLIPSIZE_END
, NULL
);
44 gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview
),
48 EPHY_COMPLETION_ACTION_COL
,
50 column
= gtk_tree_view_get_column(GTK_TREE_VIEW (treeview
), 0);
51 gtk_tree_view_column_set_expand(column
, TRUE
);
52 gtk_tree_view_column_set_resizable(column
, TRUE
);
54 renderer
= gtk_cell_renderer_text_new ();
55 g_object_set (renderer
, "ellipsize", PANGO_ELLIPSIZE_END
, NULL
);
56 gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview
),
60 EPHY_COMPLETION_EXTRA_COL
,
62 column
= gtk_tree_view_get_column(GTK_TREE_VIEW (treeview
), 1);
63 gtk_tree_view_column_set_expand(column
, TRUE
);
64 gtk_tree_view_column_set_resizable(column
, TRUE
);
66 renderer
= gtk_cell_renderer_text_new ();
67 gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview
),
71 EPHY_COMPLETION_RELEVANCE_COL
,
73 gtk_container_add (GTK_CONTAINER (scrwin
), treeview
);
75 gtk_widget_show_all (window
);