don't autoselect focus_row in case of GTK_SELECTION_EXTENDED

Fri Feb 12 00:08:01 1999  Lars Hamann  <lars@gtk.org>

        * gtk/gtklist.c (gtk_list_remove_items_internal): don't autoselect
        focus_row in case of GTK_SELECTION_EXTENDED

        * gtk/testgtk.c : few changes in list example.

        * gtk/gtklistitem.c (gtk_list_item_class_init):
        * gtk/gtkctree.c (gtk_ctree_class_init):
        * gtk/gtkclist.c (gtk_clist_class_init):
        fixed indentation, removed unused key bindings
This commit is contained in:
Lars Hamann 1999-02-11 23:47:48 +00:00 committed by Lars Hamann
parent ed219818b1
commit 1f85d83ef3
13 changed files with 539 additions and 603 deletions

View File

@ -1,3 +1,15 @@
Fri Feb 12 00:08:01 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklist.c (gtk_list_remove_items_internal): don't autoselect
focus_row in case of GTK_SELECTION_EXTENDED
* gtk/testgtk.c : few changes in list example.
* gtk/gtklistitem.c (gtk_list_item_class_init):
* gtk/gtkctree.c (gtk_ctree_class_init):
* gtk/gtkclist.c (gtk_clist_class_init):
fixed indentation, removed unused key bindings
Wed Feb 10 01:02:46 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (real_remove_row):

View File

@ -1,3 +1,15 @@
Fri Feb 12 00:08:01 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklist.c (gtk_list_remove_items_internal): don't autoselect
focus_row in case of GTK_SELECTION_EXTENDED
* gtk/testgtk.c : few changes in list example.
* gtk/gtklistitem.c (gtk_list_item_class_init):
* gtk/gtkctree.c (gtk_ctree_class_init):
* gtk/gtkclist.c (gtk_clist_class_init):
fixed indentation, removed unused key bindings
Wed Feb 10 01:02:46 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (real_remove_row):

View File

@ -1,3 +1,15 @@
Fri Feb 12 00:08:01 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklist.c (gtk_list_remove_items_internal): don't autoselect
focus_row in case of GTK_SELECTION_EXTENDED
* gtk/testgtk.c : few changes in list example.
* gtk/gtklistitem.c (gtk_list_item_class_init):
* gtk/gtkctree.c (gtk_ctree_class_init):
* gtk/gtkclist.c (gtk_clist_class_init):
fixed indentation, removed unused key bindings
Wed Feb 10 01:02:46 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (real_remove_row):

View File

@ -1,3 +1,15 @@
Fri Feb 12 00:08:01 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklist.c (gtk_list_remove_items_internal): don't autoselect
focus_row in case of GTK_SELECTION_EXTENDED
* gtk/testgtk.c : few changes in list example.
* gtk/gtklistitem.c (gtk_list_item_class_init):
* gtk/gtkctree.c (gtk_ctree_class_init):
* gtk/gtkclist.c (gtk_clist_class_init):
fixed indentation, removed unused key bindings
Wed Feb 10 01:02:46 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (real_remove_row):

View File

@ -1,3 +1,15 @@
Fri Feb 12 00:08:01 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklist.c (gtk_list_remove_items_internal): don't autoselect
focus_row in case of GTK_SELECTION_EXTENDED
* gtk/testgtk.c : few changes in list example.
* gtk/gtklistitem.c (gtk_list_item_class_init):
* gtk/gtkctree.c (gtk_ctree_class_init):
* gtk/gtkclist.c (gtk_clist_class_init):
fixed indentation, removed unused key bindings
Wed Feb 10 01:02:46 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (real_remove_row):

View File

@ -1,3 +1,15 @@
Fri Feb 12 00:08:01 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklist.c (gtk_list_remove_items_internal): don't autoselect
focus_row in case of GTK_SELECTION_EXTENDED
* gtk/testgtk.c : few changes in list example.
* gtk/gtklistitem.c (gtk_list_item_class_init):
* gtk/gtkctree.c (gtk_ctree_class_init):
* gtk/gtkclist.c (gtk_clist_class_init):
fixed indentation, removed unused key bindings
Wed Feb 10 01:02:46 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (real_remove_row):

View File

@ -1,3 +1,15 @@
Fri Feb 12 00:08:01 1999 Lars Hamann <lars@gtk.org>
* gtk/gtklist.c (gtk_list_remove_items_internal): don't autoselect
focus_row in case of GTK_SELECTION_EXTENDED
* gtk/testgtk.c : few changes in list example.
* gtk/gtklistitem.c (gtk_list_item_class_init):
* gtk/gtkctree.c (gtk_ctree_class_init):
* gtk/gtkclist.c (gtk_clist_class_init):
fixed indentation, removed unused key bindings
Wed Feb 10 01:02:46 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (real_remove_row):

View File

@ -473,6 +473,7 @@ gtk_clist_class_init (GtkCListClass *klass)
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
GtkBindingSet *binding_set;
object_class = (GtkObjectClass *) klass;
widget_class = (GtkWidgetClass *) klass;
@ -700,203 +701,102 @@ gtk_clist_class_init (GtkCListClass *klass)
klass->set_cell_contents = set_cell_contents;
klass->cell_size_request = cell_size_request;
{
GtkBindingSet *binding_set;
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set, GDK_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Home, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_End, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set, GDK_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Home, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_End, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Home,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_End,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Home,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_End,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Left, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Right, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Home, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_End, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_Left, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Right, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Home, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_End, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
"undo_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
"abort_column_resize", 0);
gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
"toggle_focus_row", 0);
gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK,
"toggle_add_mode", 0);
gtk_binding_entry_add_signal (binding_set, '/', GDK_CONTROL_MASK,
"select_all", 0);
gtk_binding_entry_add_signal (binding_set, '\\', GDK_CONTROL_MASK,
"unselect_all", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Shift_L,
GDK_RELEASE_MASK | GDK_SHIFT_MASK,
"end_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Shift_R,
GDK_RELEASE_MASK | GDK_SHIFT_MASK,
"end_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Shift_L,
GDK_RELEASE_MASK | GDK_SHIFT_MASK |
GDK_CONTROL_MASK,
"end_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Shift_R,
GDK_RELEASE_MASK | GDK_SHIFT_MASK |
GDK_CONTROL_MASK,
"end_selection", 0);
}
/*
{
GtkBindingSet *binding_set;
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set, GDK_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Home, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_End, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Up, 0,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Down, 0,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Up, 0,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Page_Down, 0,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Home, 0,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_KP_End, 0,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Left, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Left, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Right, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Right, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Home, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_End, 0,
"sroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Divide, 0,
"undo_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
"abort_column_resize", 0);
gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
"toggle_focus_row", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Multiply, 0,
"toggle_add_mode", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Add, 0,
"select_all", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Subtract, 0,
"unselect_all", 0);
gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0,
"end_selection", 0);
}
*/
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
"undo_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
"abort_column_resize", 0);
gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
"toggle_focus_row", 0);
gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK,
"toggle_add_mode", 0);
gtk_binding_entry_add_signal (binding_set, '/', GDK_CONTROL_MASK,
"select_all", 0);
gtk_binding_entry_add_signal (binding_set, '\\', GDK_CONTROL_MASK,
"unselect_all", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Shift_L,
GDK_RELEASE_MASK | GDK_SHIFT_MASK,
"end_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Shift_R,
GDK_RELEASE_MASK | GDK_SHIFT_MASK,
"end_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Shift_L,
GDK_RELEASE_MASK | GDK_SHIFT_MASK |
GDK_CONTROL_MASK,
"end_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Shift_R,
GDK_RELEASE_MASK | GDK_SHIFT_MASK |
GDK_CONTROL_MASK,
"end_selection", 0);
}
static void

View File

@ -336,6 +336,7 @@ gtk_ctree_class_init (GtkCTreeClass *klass)
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkCListClass *clist_class;
GtkBindingSet *binding_set;
object_class = (GtkObjectClass *) klass;
widget_class = (GtkWidgetClass *) klass;
@ -456,51 +457,46 @@ gtk_ctree_class_init (GtkCTreeClass *klass)
klass->tree_move = real_tree_move;
klass->change_focus_row_expansion = change_focus_row_expansion;
{
GtkBindingSet *binding_set;
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set,
'+', GDK_SHIFT_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Add, 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Add, GDK_CONTROL_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM,
GTK_CTREE_EXPANSION_EXPAND_RECURSIVE);
gtk_binding_entry_add_signal (binding_set,
'-', 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_COLLAPSE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Subtract, 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_COLLAPSE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Subtract, GDK_CONTROL_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM,
GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE);
gtk_binding_entry_add_signal (binding_set,
'=', 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Multiply, 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Multiply, GDK_CONTROL_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM,
GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE);
}
binding_set = gtk_binding_set_by_class (klass);
gtk_binding_entry_add_signal (binding_set,
'+', GDK_SHIFT_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Add, 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_EXPAND);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Add, GDK_CONTROL_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM,
GTK_CTREE_EXPANSION_EXPAND_RECURSIVE);
gtk_binding_entry_add_signal (binding_set,
'-', 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_COLLAPSE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Subtract, 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_COLLAPSE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Subtract, GDK_CONTROL_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM,
GTK_CTREE_EXPANSION_COLLAPSE_RECURSIVE);
gtk_binding_entry_add_signal (binding_set,
'=', 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Multiply, 0,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM, GTK_CTREE_EXPANSION_TOGGLE);
gtk_binding_entry_add_signal (binding_set,
GDK_KP_Multiply, GDK_CONTROL_MASK,
"change_focus_row_expansion", 1,
GTK_TYPE_ENUM,
GTK_CTREE_EXPANSION_TOGGLE_RECURSIVE);
}
static void

View File

@ -1096,7 +1096,6 @@ gtk_list_insert_items (GtkList *list,
gtk_signal_connect (GTK_OBJECT (widget), "toggle",
GTK_SIGNAL_FUNC (gtk_list_signal_item_toggle),
list);
if (GTK_WIDGET_VISIBLE (widget->parent))
{
if (GTK_WIDGET_REALIZED (widget->parent) &&
@ -1109,6 +1108,7 @@ gtk_list_insert_items (GtkList *list,
}
}
nchildren = g_list_length (list->children);
if ((position < 0) || (position > nchildren))
position = nchildren;
@ -1140,7 +1140,7 @@ gtk_list_insert_items (GtkList *list,
if (tmp_list == list->children)
list->children = items;
}
if (list->children && !list->selection &&
(list->selection_mode == GTK_SELECTION_BROWSE))
{
@ -1411,8 +1411,7 @@ gtk_list_remove_items_internal (GtkList *list,
else if (container->focus_child)
gtk_container_set_focus_child (container, new_focus_child);
if ((list->selection_mode == GTK_SELECTION_BROWSE ||
list->selection_mode == GTK_SELECTION_EXTENDED) && !list->selection)
if (list->selection_mode == GTK_SELECTION_BROWSE && !list->selection)
{
list->last_focus_child = new_focus_child;
gtk_list_select_child (list, new_focus_child);
@ -1577,7 +1576,7 @@ gtk_list_unselect_all (GtkList *list)
if (!list->children)
return;
if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (list))
gtk_list_end_drag_selection (list);

View File

@ -100,6 +100,7 @@ gtk_list_item_class_init (GtkListItemClass *class)
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkItemClass *item_class;
GtkBindingSet *binding_set;
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
@ -207,103 +208,97 @@ gtk_list_item_class_init (GtkListItemClass *class)
class->scroll_vertical = NULL;
class->toggle_add_mode = NULL;
{
GtkBindingSet *binding_set;
binding_set = gtk_binding_set_by_class (class);
gtk_binding_entry_add_signal (binding_set, GDK_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Home, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_End, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
binding_set = gtk_binding_set_by_class (class);
gtk_binding_entry_add_signal (binding_set, GDK_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, 0,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Home, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_End, GDK_CONTROL_MASK,
"scroll_vertical", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Home,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_End,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Up, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_BACKWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Page_Down, GDK_SHIFT_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_PAGE_FORWARD,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Home,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_End,
GDK_SHIFT_MASK | GDK_CONTROL_MASK,
"extend_selection", 3,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0, GTK_TYPE_BOOL, TRUE);
gtk_binding_entry_add_signal (binding_set, GDK_Left, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Right, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Home, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_End, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_Left, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_BACKWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Right, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_STEP_FORWARD,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_Home, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 0.0);
gtk_binding_entry_add_signal (binding_set, GDK_End, 0,
"scroll_horizontal", 2,
GTK_TYPE_ENUM, GTK_SCROLL_JUMP,
GTK_TYPE_FLOAT, 1.0);
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
"undo_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
"toggle_focus_row", 0);
gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK,
"toggle_add_mode", 0);
gtk_binding_entry_add_signal (binding_set, '/', GDK_CONTROL_MASK,
"select_all", 0);
gtk_binding_entry_add_signal (binding_set, '\\', GDK_CONTROL_MASK,
"unselect_all", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Shift_L,
GDK_RELEASE_MASK | GDK_SHIFT_MASK,
"end_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Shift_R,
GDK_RELEASE_MASK | GDK_SHIFT_MASK,
"end_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Shift_R,
GDK_RELEASE_MASK | GDK_SHIFT_MASK |
GDK_CONTROL_MASK,
"end_selection", 0);
}
gtk_binding_entry_add_signal (binding_set, GDK_Escape, 0,
"undo_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_space, 0,
"toggle_focus_row", 0);
gtk_binding_entry_add_signal (binding_set, GDK_space, GDK_CONTROL_MASK,
"toggle_add_mode", 0);
gtk_binding_entry_add_signal (binding_set, '/', GDK_CONTROL_MASK,
"select_all", 0);
gtk_binding_entry_add_signal (binding_set, '\\', GDK_CONTROL_MASK,
"unselect_all", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Shift_L,
GDK_RELEASE_MASK | GDK_SHIFT_MASK,
"end_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Shift_R,
GDK_RELEASE_MASK | GDK_SHIFT_MASK,
"end_selection", 0);
gtk_binding_entry_add_signal (binding_set, GDK_Shift_R,
GDK_RELEASE_MASK | GDK_SHIFT_MASK |
GDK_CONTROL_MASK,
"end_selection", 0);
}
static void

View File

@ -3281,25 +3281,45 @@ list_add (GtkWidget *widget,
static void
list_remove (GtkWidget *widget,
GtkWidget *list)
GtkList *list)
{
GList *tmp_list;
GList *clear_list;
GList *clear_list = NULL;
GList *sel_row = NULL;
GList *work = NULL;
tmp_list = GTK_LIST (list)->selection;
clear_list = NULL;
while (tmp_list)
if (list->selection_mode == GTK_SELECTION_EXTENDED)
{
clear_list = g_list_prepend (clear_list, tmp_list->data);
tmp_list = tmp_list->next;
GtkWidget *item;
item = GTK_CONTAINER (list)->focus_child;
if (!item && list->selection)
item = list->selection->data;
if (item)
{
work = g_list_find (list->children, item);
for (sel_row = work; sel_row; sel_row = sel_row->next)
if (GTK_WIDGET (sel_row->data)->state != GTK_STATE_SELECTED)
break;
if (!sel_row)
{
for (sel_row = work; sel_row; sel_row = sel_row->prev)
if (GTK_WIDGET (sel_row->data)->state != GTK_STATE_SELECTED)
break;
}
}
}
for (work = list->selection; work; work = work->next)
clear_list = g_list_prepend (clear_list, work->data);
clear_list = g_list_reverse (clear_list);
gtk_list_remove_items (GTK_LIST (list), clear_list);
g_list_free (clear_list);
if (list->selection_mode == GTK_SELECTION_EXTENDED && sel_row)
gtk_list_select_child (list, GTK_WIDGET(sel_row->data));
}
static void
@ -3309,13 +3329,6 @@ list_clear (GtkWidget *widget,
gtk_list_clear_items (GTK_LIST (list), 0, -1);
}
static void
list_undo_selection (GtkWidget *widget,
GtkWidget *list)
{
gtk_list_undo_selection (GTK_LIST (list));
}
#define RADIOMENUTOGGLED(_rmi_, __i) { \
GSList * __g; \
__i = 0; \
@ -3346,21 +3359,27 @@ static void
create_list (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
GtkWidget *box2;
GtkWidget *hbox;
GtkWidget *label;
GtkWidget *scrolled_win;
GtkWidget *list;
GtkWidget *button;
GtkWidget *separator;
GtkWidget *menu;
GtkWidget *menu_item;
GSList *group;
FILE *infile;
static OptionMenuItem items[] =
{
{ "Single", list_toggle_sel_mode },
{ "Browse", list_toggle_sel_mode },
{ "Multiple", list_toggle_sel_mode },
{ "Extended", list_toggle_sel_mode }
};
if (!window)
{
GtkWidget *cbox;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *label;
GtkWidget *scrolled_win;
GtkWidget *list;
GtkWidget *button;
GtkWidget *separator;
FILE *infile;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
@ -3370,23 +3389,21 @@ create_list (void)
gtk_window_set_title (GTK_WINDOW (window), "list");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
box1 = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), box1);
box2 = gtk_vbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 5);
gtk_widget_set_usize (scrolled_win, -1, 300);
gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (box2), scrolled_win, TRUE, TRUE, 0);
gtk_widget_set_usize (scrolled_win, -1, 300);
list = gtk_list_new ();
gtk_list_set_selection_mode (GTK_LIST (list), GTK_SELECTION_EXTENDED);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_win), list);
gtk_scrolled_window_add_with_viewport
(GTK_SCROLLED_WINDOW (scrolled_win), list);
gtk_container_set_focus_vadjustment
(GTK_CONTAINER (list),
gtk_scrolled_window_get_vadjustment
@ -3413,93 +3430,54 @@ create_list (void)
fclose (infile);
}
hbox = gtk_hbox_new (TRUE, 10);
gtk_box_pack_start (GTK_BOX (box2), hbox, FALSE, TRUE, 0);
button = gtk_button_new_with_label ("Undo Selection");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC(list_undo_selection),
list);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
button = gtk_button_new_with_label ("Remove Selection");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (list_remove),
list);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
button = gtk_button_new_with_label ("Clear List");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (list_clear),
list);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 10);
gtk_box_pack_start (GTK_BOX (box2), hbox, FALSE, TRUE, 0);
hbox = gtk_hbox_new (TRUE, 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
button = gtk_button_new_with_label ("Insert Row");
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (list_add),
list);
button = gtk_button_new_with_label ("Clear List");
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (list_clear),
list);
button = gtk_button_new_with_label ("Remove Selection");
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (list_remove),
list);
cbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), cbox, FALSE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (cbox), hbox, TRUE, FALSE, 0);
label = gtk_label_new ("Selection Mode :");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC(list_remove),
list);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
list_omenu = gtk_option_menu_new ();
menu = gtk_menu_new ();
group = NULL;
menu_item = gtk_radio_menu_item_new_with_label (group, "Single");
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (list_toggle_sel_mode), list);
group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menu_item));
gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_widget_show (menu_item);
menu_item = gtk_radio_menu_item_new_with_label (group, "Browse");
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (list_toggle_sel_mode), list);
group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menu_item));
gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_widget_show (menu_item);
menu_item = gtk_radio_menu_item_new_with_label (group, "Multiple");
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (list_toggle_sel_mode), list);
group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menu_item));
gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_widget_show (menu_item);
menu_item = gtk_radio_menu_item_new_with_label (group, "Extended");
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (list_toggle_sel_mode), list);
group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menu_item));
gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
gtk_widget_show (menu_item);
gtk_option_menu_set_menu (GTK_OPTION_MENU (list_omenu), menu);
list_omenu = build_option_menu (items, 4, 3, list);
gtk_box_pack_start (GTK_BOX (hbox), list_omenu, FALSE, TRUE, 0);
gtk_option_menu_set_history (GTK_OPTION_MENU (list_omenu), 3);
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, TRUE, 0);
box2 = gtk_vbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);
cbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), cbox, FALSE, TRUE, 0);
button = gtk_button_new_with_label ("close");
gtk_container_set_border_width (GTK_CONTAINER (button), 10);
gtk_box_pack_start (GTK_BOX (cbox), button, TRUE, TRUE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC(gtk_widget_destroy),
GTK_OBJECT (window));
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
@ -3884,8 +3862,8 @@ create_clist (void)
char text[TESTGTK_CLIST_COLUMNS][50];
char *texts[TESTGTK_CLIST_COLUMNS];
GtkWidget *box1;
GtkWidget *box2;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *clist;
GtkWidget *button;
GtkWidget *separator;
@ -3910,8 +3888,8 @@ create_clist (void)
gtk_window_set_title (GTK_WINDOW (window), "clist");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
box1 = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), box1);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 5);
@ -3927,79 +3905,79 @@ create_clist (void)
(GtkSignalFunc) clist_click_column, NULL);
/* control buttons */
box2 = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (box2), 5);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0);
hbox = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
button = gtk_button_new_with_label ("Insert Row");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) insert_row_clist, (gpointer) clist);
button = gtk_button_new_with_label ("Add 1,000 Rows With Pixmaps");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) add1000_clist, (gpointer) clist);
button = gtk_button_new_with_label ("Add 10,000 Rows");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) add10000_clist, (gpointer) clist);
/* second layer of buttons */
box2 = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (box2), 5);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0);
hbox = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
button = gtk_button_new_with_label ("Clear List");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) clear_clist, (gpointer) clist);
button = gtk_button_new_with_label ("Remove Selection");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) clist_remove_selection,
(gpointer) clist);
undo_button = gtk_button_new_with_label ("Undo Selection");
gtk_box_pack_start (GTK_BOX (box2), undo_button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), undo_button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (undo_button), "clicked",
(GtkSignalFunc) undo_selection, (gpointer) clist);
button = gtk_button_new_with_label ("Warning Test");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) clist_warning_test,(gpointer) clist);
/* third layer of buttons */
box2 = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (box2), 5);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0);
hbox = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
check = gtk_check_button_new_with_label ("Show Title Buttons");
gtk_box_pack_start (GTK_BOX (box2), check, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), check, FALSE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (check), "clicked",
GTK_SIGNAL_FUNC (toggle_title_buttons), clist);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
check = gtk_check_button_new_with_label ("Reorderable");
gtk_box_pack_start (GTK_BOX (box2), check, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), check, FALSE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (check), "clicked",
GTK_SIGNAL_FUNC (toggle_reorderable), clist);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
label = gtk_label_new ("Selection Mode :");
gtk_box_pack_start (GTK_BOX (box2), label, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
clist_omenu = build_option_menu (items, 4, 3, clist);
gtk_box_pack_start (GTK_BOX (box2), clist_omenu, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), clist_omenu, FALSE, TRUE, 0);
/*
* the rest of the clist configuration
*/
gtk_box_pack_start (GTK_BOX (box1), scrolled_win, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0);
gtk_clist_set_row_height (GTK_CLIST (clist), 18);
gtk_widget_set_usize (clist, -1, 300);
@ -4057,11 +4035,14 @@ create_clist (void)
}
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
button = gtk_button_new_with_label ("close");
gtk_container_set_border_width (GTK_CONTAINER (button), 10);
gtk_box_pack_start (GTK_BOX (box1), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC(gtk_widget_destroy),
GTK_OBJECT (window));

View File

@ -3281,25 +3281,45 @@ list_add (GtkWidget *widget,
static void
list_remove (GtkWidget *widget,
GtkWidget *list)
GtkList *list)
{
GList *tmp_list;
GList *clear_list;
GList *clear_list = NULL;
GList *sel_row = NULL;
GList *work = NULL;
tmp_list = GTK_LIST (list)->selection;
clear_list = NULL;
while (tmp_list)
if (list->selection_mode == GTK_SELECTION_EXTENDED)
{
clear_list = g_list_prepend (clear_list, tmp_list->data);
tmp_list = tmp_list->next;
GtkWidget *item;
item = GTK_CONTAINER (list)->focus_child;
if (!item && list->selection)
item = list->selection->data;
if (item)
{
work = g_list_find (list->children, item);
for (sel_row = work; sel_row; sel_row = sel_row->next)
if (GTK_WIDGET (sel_row->data)->state != GTK_STATE_SELECTED)
break;
if (!sel_row)
{
for (sel_row = work; sel_row; sel_row = sel_row->prev)
if (GTK_WIDGET (sel_row->data)->state != GTK_STATE_SELECTED)
break;
}
}
}
for (work = list->selection; work; work = work->next)
clear_list = g_list_prepend (clear_list, work->data);
clear_list = g_list_reverse (clear_list);
gtk_list_remove_items (GTK_LIST (list), clear_list);
g_list_free (clear_list);
if (list->selection_mode == GTK_SELECTION_EXTENDED && sel_row)
gtk_list_select_child (list, GTK_WIDGET(sel_row->data));
}
static void
@ -3309,13 +3329,6 @@ list_clear (GtkWidget *widget,
gtk_list_clear_items (GTK_LIST (list), 0, -1);
}
static void
list_undo_selection (GtkWidget *widget,
GtkWidget *list)
{
gtk_list_undo_selection (GTK_LIST (list));
}
#define RADIOMENUTOGGLED(_rmi_, __i) { \
GSList * __g; \
__i = 0; \
@ -3346,21 +3359,27 @@ static void
create_list (void)
{
static GtkWidget *window = NULL;
GtkWidget *box1;
GtkWidget *box2;
GtkWidget *hbox;
GtkWidget *label;
GtkWidget *scrolled_win;
GtkWidget *list;
GtkWidget *button;
GtkWidget *separator;
GtkWidget *menu;
GtkWidget *menu_item;
GSList *group;
FILE *infile;
static OptionMenuItem items[] =
{
{ "Single", list_toggle_sel_mode },
{ "Browse", list_toggle_sel_mode },
{ "Multiple", list_toggle_sel_mode },
{ "Extended", list_toggle_sel_mode }
};
if (!window)
{
GtkWidget *cbox;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *label;
GtkWidget *scrolled_win;
GtkWidget *list;
GtkWidget *button;
GtkWidget *separator;
FILE *infile;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
@ -3370,23 +3389,21 @@ create_list (void)
gtk_window_set_title (GTK_WINDOW (window), "list");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
box1 = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), box1);
box2 = gtk_vbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
gtk_box_pack_start (GTK_BOX (box1), box2, TRUE, TRUE, 0);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 5);
gtk_widget_set_usize (scrolled_win, -1, 300);
gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (box2), scrolled_win, TRUE, TRUE, 0);
gtk_widget_set_usize (scrolled_win, -1, 300);
list = gtk_list_new ();
gtk_list_set_selection_mode (GTK_LIST (list), GTK_SELECTION_EXTENDED);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_win), list);
gtk_scrolled_window_add_with_viewport
(GTK_SCROLLED_WINDOW (scrolled_win), list);
gtk_container_set_focus_vadjustment
(GTK_CONTAINER (list),
gtk_scrolled_window_get_vadjustment
@ -3413,93 +3430,54 @@ create_list (void)
fclose (infile);
}
hbox = gtk_hbox_new (TRUE, 10);
gtk_box_pack_start (GTK_BOX (box2), hbox, FALSE, TRUE, 0);
button = gtk_button_new_with_label ("Undo Selection");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC(list_undo_selection),
list);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
button = gtk_button_new_with_label ("Remove Selection");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (list_remove),
list);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
button = gtk_button_new_with_label ("Clear List");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (list_clear),
list);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 10);
gtk_box_pack_start (GTK_BOX (box2), hbox, FALSE, TRUE, 0);
hbox = gtk_hbox_new (TRUE, 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
button = gtk_button_new_with_label ("Insert Row");
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (list_add),
list);
button = gtk_button_new_with_label ("Clear List");
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (list_clear),
list);
button = gtk_button_new_with_label ("Remove Selection");
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (list_remove),
list);
cbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), cbox, FALSE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (cbox), hbox, TRUE, FALSE, 0);
label = gtk_label_new ("Selection Mode :");
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC(list_remove),
list);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
list_omenu = gtk_option_menu_new ();
menu = gtk_menu_new ();
group = NULL;
menu_item = gtk_radio_menu_item_new_with_label (group, "Single");
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (list_toggle_sel_mode), list);
group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menu_item));
gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_widget_show (menu_item);
menu_item = gtk_radio_menu_item_new_with_label (group, "Browse");
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (list_toggle_sel_mode), list);
group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menu_item));
gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_widget_show (menu_item);
menu_item = gtk_radio_menu_item_new_with_label (group, "Multiple");
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (list_toggle_sel_mode), list);
group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menu_item));
gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_widget_show (menu_item);
menu_item = gtk_radio_menu_item_new_with_label (group, "Extended");
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
GTK_SIGNAL_FUNC (list_toggle_sel_mode), list);
group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menu_item));
gtk_menu_append (GTK_MENU (menu), menu_item);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE);
gtk_widget_show (menu_item);
gtk_option_menu_set_menu (GTK_OPTION_MENU (list_omenu), menu);
list_omenu = build_option_menu (items, 4, 3, list);
gtk_box_pack_start (GTK_BOX (hbox), list_omenu, FALSE, TRUE, 0);
gtk_option_menu_set_history (GTK_OPTION_MENU (list_omenu), 3);
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, TRUE, 0);
box2 = gtk_vbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);
cbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), cbox, FALSE, TRUE, 0);
button = gtk_button_new_with_label ("close");
gtk_container_set_border_width (GTK_CONTAINER (button), 10);
gtk_box_pack_start (GTK_BOX (cbox), button, TRUE, TRUE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC(gtk_widget_destroy),
GTK_OBJECT (window));
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
gtk_widget_grab_default (button);
@ -3884,8 +3862,8 @@ create_clist (void)
char text[TESTGTK_CLIST_COLUMNS][50];
char *texts[TESTGTK_CLIST_COLUMNS];
GtkWidget *box1;
GtkWidget *box2;
GtkWidget *vbox;
GtkWidget *hbox;
GtkWidget *clist;
GtkWidget *button;
GtkWidget *separator;
@ -3910,8 +3888,8 @@ create_clist (void)
gtk_window_set_title (GTK_WINDOW (window), "clist");
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
box1 = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), box1);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 5);
@ -3927,79 +3905,79 @@ create_clist (void)
(GtkSignalFunc) clist_click_column, NULL);
/* control buttons */
box2 = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (box2), 5);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0);
hbox = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
button = gtk_button_new_with_label ("Insert Row");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) insert_row_clist, (gpointer) clist);
button = gtk_button_new_with_label ("Add 1,000 Rows With Pixmaps");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) add1000_clist, (gpointer) clist);
button = gtk_button_new_with_label ("Add 10,000 Rows");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) add10000_clist, (gpointer) clist);
/* second layer of buttons */
box2 = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (box2), 5);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0);
hbox = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
button = gtk_button_new_with_label ("Clear List");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) clear_clist, (gpointer) clist);
button = gtk_button_new_with_label ("Remove Selection");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) clist_remove_selection,
(gpointer) clist);
undo_button = gtk_button_new_with_label ("Undo Selection");
gtk_box_pack_start (GTK_BOX (box2), undo_button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), undo_button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (undo_button), "clicked",
(GtkSignalFunc) undo_selection, (gpointer) clist);
button = gtk_button_new_with_label ("Warning Test");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked",
(GtkSignalFunc) clist_warning_test,(gpointer) clist);
/* third layer of buttons */
box2 = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (box2), 5);
gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, FALSE, 0);
hbox = gtk_hbox_new (FALSE, 5);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
check = gtk_check_button_new_with_label ("Show Title Buttons");
gtk_box_pack_start (GTK_BOX (box2), check, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), check, FALSE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (check), "clicked",
GTK_SIGNAL_FUNC (toggle_title_buttons), clist);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
check = gtk_check_button_new_with_label ("Reorderable");
gtk_box_pack_start (GTK_BOX (box2), check, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), check, FALSE, TRUE, 0);
gtk_signal_connect (GTK_OBJECT (check), "clicked",
GTK_SIGNAL_FUNC (toggle_reorderable), clist);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
label = gtk_label_new ("Selection Mode :");
gtk_box_pack_start (GTK_BOX (box2), label, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
clist_omenu = build_option_menu (items, 4, 3, clist);
gtk_box_pack_start (GTK_BOX (box2), clist_omenu, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), clist_omenu, FALSE, TRUE, 0);
/*
* the rest of the clist configuration
*/
gtk_box_pack_start (GTK_BOX (box1), scrolled_win, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE, 0);
gtk_clist_set_row_height (GTK_CLIST (clist), 18);
gtk_widget_set_usize (clist, -1, 300);
@ -4057,11 +4035,14 @@ create_clist (void)
}
separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), separator, FALSE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
button = gtk_button_new_with_label ("close");
gtk_container_set_border_width (GTK_CONTAINER (button), 10);
gtk_box_pack_start (GTK_BOX (box1), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC(gtk_widget_destroy),
GTK_OBJECT (window));