Ejemplo n.º 1
0
/**
 * Convenience routine to plug a callback on the column to handle clicks.
 *
 * The callback should perform the necessary context extraction and then
 * should end-up calling column_sort_tristate().
 *
 * @param column		the column for which we want to handle header clicks
 * @param cb			the GTK callback to invoke
 * @param udata			the parameter to pass to the GTK callback
 */
void
column_sort_tristate_register(GtkTreeViewColumn *column,
                              column_tristate_cb_t cb, void *udata)
{
#if GTK_CHECK_VERSION(2,6,0)
    gui_signal_connect_after(column, "clicked", cb, udata);
#endif	/* GTK+ >= 2.6.0 */
}
Ejemplo n.º 2
0
static void
search_list_tree_view_init(void)
{
	GtkTreeView *tv;
	
    tv = GTK_TREE_VIEW(gui_main_window_lookup("tree_view_search"));
    tree_view_search = tv;

	gtk_tree_view_set_reorderable(tv, TRUE);	
	gtk_tree_selection_set_mode(gtk_tree_view_get_selection(tv),
		GTK_SELECTION_MULTIPLE);
	gtk_tree_view_set_model(tv, create_searches_model());
	add_list_columns(tv);

	widget_add_popup_menu(GTK_WIDGET(tv),
		search_gui_get_search_list_popup_menu);
	gui_signal_connect(tv,
		"button-release-event", on_search_list_button_release_event, NULL);
	gui_signal_connect(tv,
		"key-release-event", on_search_list_key_release_event, NULL);
	gui_signal_connect_after(gtk_tree_view_get_model(tv),
		"row-deleted", on_search_list_row_deleted, NULL);
}