Commit 94f4c71e authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Make the list of demos scrollable.

2005-06-27  Matthias Clasen  <mclasen@redhat.com>

	* demos/gtk-demo/main.c (create_tree): Make the list of
	demos scrollable.
parent 86e4f7d1
2005-06-27 Matthias Clasen <mclasen@redhat.com>
* demos/gtk-demo/main.c (create_tree): Make the list of
demos scrollable.
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_line_end):
Fix positioning at the end of the line for lines ending
in invisible characters.
......
2005-06-27 Matthias Clasen <mclasen@redhat.com>
* demos/gtk-demo/main.c (create_tree): Make the list of
demos scrollable.
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_line_end):
Fix positioning at the end of the line for lines ending
in invisible characters.
......
2005-06-27 Matthias Clasen <mclasen@redhat.com>
* demos/gtk-demo/main.c (create_tree): Make the list of
demos scrollable.
* gtk/gtktextlayout.c (gtk_text_layout_move_iter_to_line_end):
Fix positioning at the end of the line for lines ending
in invisible characters.
......
......@@ -696,6 +696,7 @@ create_tree (void)
GtkTreeViewColumn *column;
GtkTreeStore *model;
GtkTreeIter iter;
GtkWidget *box, *label, *scrolled_window;
Demo *d = testgtk_demos;
......@@ -763,11 +764,29 @@ create_tree (void)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
GTK_TREE_VIEW_COLUMN (column));
gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &iter);
gtk_tree_selection_select_iter (GTK_TREE_SELECTION (selection), &iter);
g_signal_connect (selection, "changed", G_CALLBACK (selection_cb), model);
g_signal_connect (tree_view, "row_activated", G_CALLBACK (row_activated_cb), model);
gtk_tree_view_expand_all (GTK_TREE_VIEW (tree_view));
return tree_view;
gtk_tree_view_collapse_all (GTK_TREE_VIEW (tree_view));
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_view), FALSE);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
label = gtk_label_new ("Widget (double click for demo)");
box = gtk_notebook_new ();
gtk_notebook_append_page (GTK_NOTEBOOK (box), scrolled_window, label);
gtk_widget_grab_focus (tree_view);
return box;
}
static void
......
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