Re: API Freeze Schedule and outstanding API bugs



Le 08/06/01 00:40:03, Owen Taylor a écrit :
> Patches ready to apply
> ======================

What about the one I posted here about TreeView "expander column" (I didn't
open a bug, should I have?)
http://mail.gnome.org/archives/gtk-devel-list/2001-June/msg00023.html

Currently, the expander_column refers to the offset of a displayed column
view. When you dnd that column, expander arrows don't follow it.

The question here is: is it more likely that people want expander arrows
attached to a specific column, following it when dnd'ed, or location?

The first option appears more logical to me.

If one wants to have "fixed" expander arrows, it's likely to be only in the
left side (or right side if direction is RTL, and when TreeView will
support it).

In the rare cases (if any ; I can't find any reason for this) in which one
will want to have expander arrows attached to a specific location, not on
the left (or right) side and not following dnd, he'll still be able to
change the expander_column on columns_changed event.

----------------

Still about TreeView, and DnD.
API has changed recently to set "dragability" (called "reorderability") in
a column by column basis.
Either it is not finished or I don't see what was the issue here.

The problem is that even if you set a column as "unreorderable", you can
still move it by moving other columns around.
Make a simple TreeView with 3 columns for example (see attached file), and
set only the second and third TreeViewColumns as reorderable. You can move
the first column to the right end of the window just dragging the second
and third columns before it.

So how is reordering supposed to work?

Tom.
#include <gtk/gtk.h>

int
main (int argc, char **argv) {
    GtkWidget *w, *tv;
    GtkListStore *model;
    GtkTreeViewColumn *col;
    GtkCellRenderer *cell;
    GtkTreeIter iter;

    gtk_init (&argc, &argv);

    w = gtk_window_new (GTK_WINDOW_TOPLEVEL);

    model = gtk_list_store_new_with_types (3, G_TYPE_STRING,
					   G_TYPE_STRING,
					   G_TYPE_STRING);
    tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));

    gtk_list_store_append (GTK_LIST_STORE (model), &iter);
    gtk_list_store_set (GTK_LIST_STORE (model), &iter,
			0, "0", 1, "1", 2, "2",
			-1);

    cell = gtk_cell_renderer_text_new ();

    /* col 1, not reorderable */
    col = gtk_tree_view_column_new_with_attributes ("col1", cell,
						    "text", 0,
						    NULL);
    gtk_tree_view_append_column (GTK_TREE_VIEW (tv), col);

    /* col 2, reorderable */
    col = gtk_tree_view_column_new_with_attributes ("col2", cell,
						    "text", 1,
						    NULL);
    gtk_tree_view_column_set_reorderable (col, TRUE);
    gtk_tree_view_append_column (GTK_TREE_VIEW (tv), col);

    /* col 3, reorderable */
    col = gtk_tree_view_column_new_with_attributes ("col3", cell,
						    "text", 2,
						    NULL);
    gtk_tree_view_column_set_reorderable (col, TRUE);
    gtk_tree_view_append_column (GTK_TREE_VIEW (tv), col);

    gtk_container_add (GTK_CONTAINER (w), tv);

    gtk_signal_connect (GTK_OBJECT(w), "delete-event",
			GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
    gtk_widget_show_all (w);

    gtk_main ();

    return 0;
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]