Commit 59444d85 authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

Now it's a GObject instead of a GtkObject. The

Thu Jun  7 18:25:42 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeselection.c: Now it's a GObject instead of a
	GtkObject.  The GtkTreeSelection::selection_changed signal is now
	the GtkTreeSelection::changed signal.

	* gtk/gtktreeview.c: Modified to deal with new GtkTreeSelection
	object.

	* tests/gtktree*.c: Modified to deal with new GtkTreeSelection
	object.
parent 10b868eb
Thu Jun 7 18:25:42 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c: Now it's a GObject instead of a
GtkObject. The GtkTreeSelection::selection_changed signal is now
the GtkTreeSelection::changed signal.
* gtk/gtktreeview.c: Modified to deal with new GtkTreeSelection
object.
* tests/gtktree*.c: Modified to deal with new GtkTreeSelection
object.
2001-06-07 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am: fix glib-mkenums and glib-genmarshal again
......
Thu Jun 7 18:25:42 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c: Now it's a GObject instead of a
GtkObject. The GtkTreeSelection::selection_changed signal is now
the GtkTreeSelection::changed signal.
* gtk/gtktreeview.c: Modified to deal with new GtkTreeSelection
object.
* tests/gtktree*.c: Modified to deal with new GtkTreeSelection
object.
2001-06-07 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am: fix glib-mkenums and glib-genmarshal again
......
Thu Jun 7 18:25:42 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c: Now it's a GObject instead of a
GtkObject. The GtkTreeSelection::selection_changed signal is now
the GtkTreeSelection::changed signal.
* gtk/gtktreeview.c: Modified to deal with new GtkTreeSelection
object.
* tests/gtktree*.c: Modified to deal with new GtkTreeSelection
object.
2001-06-07 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am: fix glib-mkenums and glib-genmarshal again
......
Thu Jun 7 18:25:42 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c: Now it's a GObject instead of a
GtkObject. The GtkTreeSelection::selection_changed signal is now
the GtkTreeSelection::changed signal.
* gtk/gtktreeview.c: Modified to deal with new GtkTreeSelection
object.
* tests/gtktree*.c: Modified to deal with new GtkTreeSelection
object.
2001-06-07 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am: fix glib-mkenums and glib-genmarshal again
......
Thu Jun 7 18:25:42 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c: Now it's a GObject instead of a
GtkObject. The GtkTreeSelection::selection_changed signal is now
the GtkTreeSelection::changed signal.
* gtk/gtktreeview.c: Modified to deal with new GtkTreeSelection
object.
* tests/gtktree*.c: Modified to deal with new GtkTreeSelection
object.
2001-06-07 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am: fix glib-mkenums and glib-genmarshal again
......
Thu Jun 7 18:25:42 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c: Now it's a GObject instead of a
GtkObject. The GtkTreeSelection::selection_changed signal is now
the GtkTreeSelection::changed signal.
* gtk/gtktreeview.c: Modified to deal with new GtkTreeSelection
object.
* tests/gtktree*.c: Modified to deal with new GtkTreeSelection
object.
2001-06-07 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am: fix glib-mkenums and glib-genmarshal again
......
Thu Jun 7 18:25:42 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeselection.c: Now it's a GObject instead of a
GtkObject. The GtkTreeSelection::selection_changed signal is now
the GtkTreeSelection::changed signal.
* gtk/gtktreeview.c: Modified to deal with new GtkTreeSelection
object.
* tests/gtktree*.c: Modified to deal with new GtkTreeSelection
object.
2001-06-07 Havoc Pennington <hp@redhat.com>
* gtk/Makefile.am: fix glib-mkenums and glib-genmarshal again
......
......@@ -35,11 +35,11 @@ static gint gtk_tree_selection_real_select_node (GtkTreeSelection *selecti
enum
{
SELECTION_CHANGED,
CHANGED,
LAST_SIGNAL
};
static GtkObjectClass *parent_class = NULL;
static GObjectClass *parent_class = NULL;
static guint tree_selection_signals[LAST_SIGNAL] = { 0 };
GtkType
......@@ -62,7 +62,7 @@ gtk_tree_selection_get_type (void)
(GInstanceInitFunc) gtk_tree_selection_init
};
selection_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkTreeSelection", &selection_info, 0);
selection_type = g_type_register_static (G_TYPE_OBJECT, "GtkTreeSelection", &selection_info, 0);
}
return selection_type;
......@@ -77,13 +77,13 @@ gtk_tree_selection_class_init (GtkTreeSelectionClass *class)
parent_class = g_type_class_peek_parent (class);
object_class->finalize = gtk_tree_selection_finalize;
class->selection_changed = NULL;
class->changed = NULL;
tree_selection_signals[SELECTION_CHANGED] =
gtk_signal_new ("selection_changed",
tree_selection_signals[CHANGED] =
gtk_signal_new ("changed",
GTK_RUN_FIRST,
GTK_CLASS_TYPE (object_class),
GTK_SIGNAL_OFFSET (GtkTreeSelectionClass, selection_changed),
GTK_SIGNAL_OFFSET (GtkTreeSelectionClass, changed),
gtk_marshal_VOID__VOID,
GTK_TYPE_NONE, 0);
}
......@@ -114,7 +114,7 @@ _gtk_tree_selection_new (void)
{
GtkTreeSelection *selection;
selection = GTK_TREE_SELECTION (gtk_type_new (GTK_TYPE_TREE_SELECTION));
selection = GTK_TREE_SELECTION (g_object_new (GTK_TYPE_TREE_SELECTION, NULL));
return selection;
}
......@@ -649,7 +649,7 @@ gtk_tree_selection_select_all (GtkTreeSelection *selection)
g_return_if_fail (selection->type != GTK_TREE_SELECTION_MULTI);
if (gtk_tree_selection_real_select_all (selection))
gtk_signal_emit (GTK_OBJECT (selection), tree_selection_signals[SELECTION_CHANGED]);
g_signal_emit (G_OBJECT (selection), tree_selection_signals[CHANGED], 0);
}
static void
......@@ -750,7 +750,7 @@ gtk_tree_selection_unselect_all (GtkTreeSelection *selection)
return;
if (gtk_tree_selection_real_unselect_all (selection))
gtk_signal_emit (GTK_OBJECT (selection), tree_selection_signals[SELECTION_CHANGED]);
g_signal_emit (G_OBJECT (selection), tree_selection_signals[CHANGED], 0);
}
static gint
......@@ -861,7 +861,7 @@ gtk_tree_selection_select_range (GtkTreeSelection *selection,
g_return_if_fail (selection->tree_view != NULL);
if (gtk_tree_selection_real_select_range (selection, start_path, end_path))
gtk_signal_emit (GTK_OBJECT (selection), tree_selection_signals[SELECTION_CHANGED]);
gtk_signal_emit (G_OBJECT (selection), tree_selection_signals[CHANGED], 0);
}
/* Called internally by gtktreeview.c It handles actually selecting the tree.
......@@ -977,7 +977,7 @@ _gtk_tree_selection_internal_select_node (GtkTreeSelection *selection,
gtk_tree_path_free (anchor_path);
if (dirty)
gtk_signal_emit (GTK_OBJECT (selection), tree_selection_signals[SELECTION_CHANGED]);
g_signal_emit (G_OBJECT (selection), tree_selection_signals[CHANGED], 0);
}
/* NOTE: Any {un,}selection ever done _MUST_ be done through this function!
......
......@@ -50,7 +50,7 @@ typedef void (* GtkTreeSelectionForeachFunc) (GtkTreeModel *model,
struct _GtkTreeSelection
{
GtkObject parent;
GObject parent;
/*< private >*/
......@@ -63,9 +63,9 @@ struct _GtkTreeSelection
struct _GtkTreeSelectionClass
{
GtkObjectClass parent_class;
GObjectClass parent_class;
void (* selection_changed) (GtkTreeView *tree_view);
void (* changed) (GtkTreeView *tree_view);
};
......
......@@ -234,7 +234,7 @@ gtk_tree_store_init (GtkTreeStore *tree_store)
GtkTreeStore *
gtk_tree_store_new (void)
{
return GTK_TREE_STORE (g_object_new (gtk_tree_store_get_type (), NULL));
return GTK_TREE_STORE (g_object_new (GTK_TYPE_TREE_STORE, NULL));
}
GtkTreeStore *
......
......@@ -4343,8 +4343,7 @@ gtk_tree_view_deleted (GtkTreeModel *model,
{
if (GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) &&
tree_view->priv->selection)
gtk_signal_emit_by_name (GTK_OBJECT (tree_view->priv->selection),
"selection_changed");
g_signal_emit_by_name (G_OBJECT (tree_view->priv->selection), "changed");
}
if (anchor_path)
......
......@@ -202,9 +202,6 @@ gboolean gtk_tree_view_column_cell_event (GtkTreeViewCol
guint flags);
#ifdef __cplusplus
}
#endif /* __cplusplus */
......
......@@ -274,7 +274,7 @@ make_window (gint view_type)
button = gtk_button_new_with_label ("gtk_tree_store_remove");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
g_signal_connectc (G_OBJECT (selection),
"selection_changed",
"changed",
selection_changed,
button, FALSE);
gtk_signal_connect (GTK_OBJECT (button), "clicked", iter_remove, tree_view);
......@@ -294,7 +294,7 @@ make_window (gint view_type)
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked", iter_insert_before, tree_view);
g_signal_connectc (G_OBJECT (selection),
"selection_changed",
"changed",
selection_changed,
button, FALSE);
gtk_widget_set_sensitive (button, FALSE);
......@@ -303,7 +303,7 @@ make_window (gint view_type)
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked", iter_insert_after, tree_view);
g_signal_connectc (GTK_OBJECT (selection),
"selection_changed",
"changed",
selection_changed,
button, FALSE);
gtk_widget_set_sensitive (button, FALSE);
......
......@@ -357,7 +357,7 @@ selection_received (GtkWidget *widget, GtkSelectionData *data)
void
paste (GtkWidget *widget, GtkWidget *entry)
{
char *name;
const char *name;
GdkAtom atom;
name = gtk_entry_get_text (GTK_ENTRY(entry));
......
......@@ -15,7 +15,6 @@ add_buttons (GtkWidget *widget, GtkWidget *box)
{
GtkWidget *add_button;
GtkWidget *remove_button;
GtkWidget *toplevel = gtk_widget_get_toplevel (box);
add_button = gtk_button_new_with_mnemonic ("_Add");
gtk_box_pack_start (GTK_BOX (box), add_button, TRUE, TRUE, 0);
......
......@@ -603,15 +603,15 @@ main (int argc, char *argv[])
button = gtk_button_new_with_label ("<<");
gtk_widget_set_sensitive (button, FALSE);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (add_left_clicked), top_right_tree_view);
gtk_signal_connect (GTK_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (top_right_tree_view))),
"selection-changed", GTK_SIGNAL_FUNC (selection_changed), button);
g_signal_connectc (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (top_right_tree_view))),
"changed", GTK_SIGNAL_FUNC (selection_changed), button, FALSE);
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
button = gtk_button_new_with_label (">>");
gtk_widget_set_sensitive (button, FALSE);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (add_right_clicked), top_right_tree_view);
gtk_signal_connect (GTK_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (left_tree_view))),
"selection-changed", GTK_SIGNAL_FUNC (selection_changed), button);
g_signal_connectc (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (left_tree_view))),
"changed", GTK_SIGNAL_FUNC (selection_changed), button, FALSE);
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
bbox = gtk_vbutton_box_new ();
......@@ -622,15 +622,15 @@ main (int argc, char *argv[])
button = gtk_button_new_with_label ("<<");
gtk_widget_set_sensitive (button, FALSE);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (add_left_clicked), bottom_right_tree_view);
gtk_signal_connect (GTK_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (bottom_right_tree_view))),
"selection-changed", GTK_SIGNAL_FUNC (selection_changed), button);
g_signal_connectc (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (bottom_right_tree_view))),
"changed", GTK_SIGNAL_FUNC (selection_changed), button, FALSE);
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
button = gtk_button_new_with_label (">>");
gtk_widget_set_sensitive (button, FALSE);
gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (add_right_clicked), bottom_right_tree_view);
gtk_signal_connect (GTK_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (left_tree_view))),
"selection-changed", GTK_SIGNAL_FUNC (selection_changed), button);
g_signal_connectc (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (left_tree_view))),
"changed", GTK_SIGNAL_FUNC (selection_changed), button, FALSE);
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
......
......@@ -309,6 +309,7 @@ main (int argc, char *argv[])
GtkCellRenderer *renderer;
gint col_offset;
GtkTreeViewColumn *column;
GtkTreeSelection *selection;
gtk_init (&argc, &argv);
......@@ -328,19 +329,20 @@ main (int argc, char *argv[])
model = make_model ();
tree_view = gtk_tree_view_new_with_model (model);
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tree_view), TRUE);
gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)),
GTK_TREE_SELECTION_MULTI);
renderer = gtk_cell_renderer_text_new ();
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-1, "Holiday",
renderer,
"text", HOLIDAY_COLUMN, NULL);
col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-1, "Holiday",
renderer,
"text", HOLIDAY_COLUMN, NULL);
column = gtk_tree_view_get_column (GTK_TREE_VIEW (tree_view), col_offset - 1);
gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
g_object_unref (renderer);
/* Alex Column */
renderer = gtk_cell_renderer_toggle_new ();
g_signal_connect_data (G_OBJECT (renderer), "toggled", alex_toggled, model, NULL, FALSE, FALSE);
g_signal_connect_data (G_OBJECT (renderer), "toggled", G_CALLBACK (alex_toggled), model, NULL, FALSE, FALSE);
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
......@@ -358,7 +360,7 @@ main (int argc, char *argv[])
/* Havoc Column */
renderer = gtk_cell_renderer_toggle_new ();
g_signal_connect_data (G_OBJECT (renderer), "toggled", havoc_toggled, model, NULL, FALSE, FALSE);
g_signal_connect_data (G_OBJECT (renderer), "toggled", G_CALLBACK (havoc_toggled), model, NULL, FALSE, FALSE);
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
......@@ -375,7 +377,7 @@ main (int argc, char *argv[])
/* Tim Column */
renderer = gtk_cell_renderer_toggle_new ();
g_signal_connect_data (G_OBJECT (renderer), "toggled", tim_toggled, model, NULL, FALSE, FALSE);
g_signal_connect_data (G_OBJECT (renderer), "toggled", G_CALLBACK (tim_toggled), model, NULL, FALSE, FALSE);
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
......@@ -393,7 +395,7 @@ main (int argc, char *argv[])
/* Owen Column */
renderer = gtk_cell_renderer_toggle_new ();
g_signal_connect_data (G_OBJECT (renderer), "toggled", owen_toggled, model, NULL, FALSE, FALSE);
g_signal_connect_data (G_OBJECT (renderer), "toggled", G_CALLBACK (owen_toggled), model, NULL, FALSE, FALSE);
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-1, "Owen",
......@@ -409,7 +411,7 @@ main (int argc, char *argv[])
/* Owen Column */
renderer = gtk_cell_renderer_toggle_new ();
g_signal_connect_data (G_OBJECT (renderer), "toggled", dave_toggled, model, NULL, FALSE, FALSE);
g_signal_connect_data (G_OBJECT (renderer), "toggled", G_CALLBACK (dave_toggled), model, NULL, FALSE, FALSE);
g_object_set (G_OBJECT (renderer), "xalign", 0.0, NULL);
col_offset = gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tree_view),
-1, "Dave",
......
......@@ -315,7 +315,7 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), col);
pixbuf = gdk_pixbuf_new_from_xpm_data ((char **)book_closed_xpm);
pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **)book_closed_xpm);
image = gtk_image_new_from_pixbuf (pixbuf);
......
......@@ -274,7 +274,7 @@ make_window (gint view_type)
button = gtk_button_new_with_label ("gtk_tree_store_remove");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
g_signal_connectc (G_OBJECT (selection),
"selection_changed",
"changed",
selection_changed,
button, FALSE);
gtk_signal_connect (GTK_OBJECT (button), "clicked", iter_remove, tree_view);
......@@ -294,7 +294,7 @@ make_window (gint view_type)
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked", iter_insert_before, tree_view);
g_signal_connectc (G_OBJECT (selection),
"selection_changed",
"changed",
selection_changed,
button, FALSE);
gtk_widget_set_sensitive (button, FALSE);
......@@ -302,8 +302,8 @@ make_window (gint view_type)
button = gtk_button_new_with_label ("gtk_tree_store_insert_after");
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "clicked", iter_insert_after, tree_view);
g_signal_connectc (GTK_OBJECT (selection),
"selection_changed",
g_signal_connectc (G_OBJECT (selection),
"changed",
selection_changed,
button, FALSE);
gtk_widget_set_sensitive (button, FALSE);
......
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