mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
modified to use "row_activated" signal.
Fri Mar 16 18:24:53 2001 Jonathan Blandford <jrb@redhat.com> * demos/gtk-demo/main.c (row_activated_cb): modified to use "row_activated" signal. * gtk/gtktreeview.c (gtk_tree_view_row_activated): oh, the stupidity. Lets actually pass in the row with this signal...
This commit is contained in:
parent
4d4af2941e
commit
73dc88d241
@ -1,3 +1,11 @@
|
||||
Fri Mar 16 18:24:53 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* demos/gtk-demo/main.c (row_activated_cb): modified to use
|
||||
"row_activated" signal.
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_row_activated): oh, the
|
||||
stupidity. Lets actually pass in the row with this signal...
|
||||
|
||||
Fri Mar 16 18:01:17 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeviewcolumn.[ch]: s/GTK_TREE_COLUMN/GTK_TREE_VIEW_COLUMN
|
||||
|
@ -1,3 +1,11 @@
|
||||
Fri Mar 16 18:24:53 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* demos/gtk-demo/main.c (row_activated_cb): modified to use
|
||||
"row_activated" signal.
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_row_activated): oh, the
|
||||
stupidity. Lets actually pass in the row with this signal...
|
||||
|
||||
Fri Mar 16 18:01:17 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeviewcolumn.[ch]: s/GTK_TREE_COLUMN/GTK_TREE_VIEW_COLUMN
|
||||
|
@ -1,3 +1,11 @@
|
||||
Fri Mar 16 18:24:53 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* demos/gtk-demo/main.c (row_activated_cb): modified to use
|
||||
"row_activated" signal.
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_row_activated): oh, the
|
||||
stupidity. Lets actually pass in the row with this signal...
|
||||
|
||||
Fri Mar 16 18:01:17 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeviewcolumn.[ch]: s/GTK_TREE_COLUMN/GTK_TREE_VIEW_COLUMN
|
||||
|
@ -1,3 +1,11 @@
|
||||
Fri Mar 16 18:24:53 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* demos/gtk-demo/main.c (row_activated_cb): modified to use
|
||||
"row_activated" signal.
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_row_activated): oh, the
|
||||
stupidity. Lets actually pass in the row with this signal...
|
||||
|
||||
Fri Mar 16 18:01:17 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeviewcolumn.[ch]: s/GTK_TREE_COLUMN/GTK_TREE_VIEW_COLUMN
|
||||
|
@ -1,3 +1,11 @@
|
||||
Fri Mar 16 18:24:53 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* demos/gtk-demo/main.c (row_activated_cb): modified to use
|
||||
"row_activated" signal.
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_row_activated): oh, the
|
||||
stupidity. Lets actually pass in the row with this signal...
|
||||
|
||||
Fri Mar 16 18:01:17 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeviewcolumn.[ch]: s/GTK_TREE_COLUMN/GTK_TREE_VIEW_COLUMN
|
||||
|
@ -1,3 +1,11 @@
|
||||
Fri Mar 16 18:24:53 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* demos/gtk-demo/main.c (row_activated_cb): modified to use
|
||||
"row_activated" signal.
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_row_activated): oh, the
|
||||
stupidity. Lets actually pass in the row with this signal...
|
||||
|
||||
Fri Mar 16 18:01:17 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeviewcolumn.[ch]: s/GTK_TREE_COLUMN/GTK_TREE_VIEW_COLUMN
|
||||
|
@ -1,3 +1,11 @@
|
||||
Fri Mar 16 18:24:53 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* demos/gtk-demo/main.c (row_activated_cb): modified to use
|
||||
"row_activated" signal.
|
||||
|
||||
* gtk/gtktreeview.c (gtk_tree_view_row_activated): oh, the
|
||||
stupidity. Lets actually pass in the row with this signal...
|
||||
|
||||
Fri Mar 16 18:01:17 2001 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* gtk/gtktreeviewcolumn.[ch]: s/GTK_TREE_COLUMN/GTK_TREE_VIEW_COLUMN
|
||||
|
@ -299,6 +299,47 @@ button_press_event_cb (GtkTreeView *tree_view,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
row_activated_cb (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
GtkTreeViewColumn *column,
|
||||
GtkTreeModel *model)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
gboolean italic;
|
||||
GDoDemoFunc func;
|
||||
GtkWidget *window;
|
||||
|
||||
gtk_tree_model_get_iter (model, &iter, path);
|
||||
gtk_tree_model_get (GTK_TREE_MODEL (model),
|
||||
&iter,
|
||||
FUNC_COLUMN, &func,
|
||||
ITALIC_COLUMN, &italic,
|
||||
-1);
|
||||
gtk_tree_store_set (GTK_TREE_STORE (model),
|
||||
&iter,
|
||||
ITALIC_COLUMN, !italic,
|
||||
-1);
|
||||
window = (func) ();
|
||||
if (window != NULL)
|
||||
{
|
||||
CallbackData *cbdata;
|
||||
|
||||
cbdata = g_new (CallbackData, 1);
|
||||
cbdata->model = model;
|
||||
cbdata->path = gtk_tree_path_copy (path);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (window),
|
||||
"destroy",
|
||||
window_closed_cb,
|
||||
cbdata);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
selection_cb (GtkTreeSelection *selection,
|
||||
GtkTreeModel *model)
|
||||
@ -400,7 +441,7 @@ create_tree (void)
|
||||
GTK_TREE_VIEW_COLUMN (column));
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (selection), "selection_changed", selection_cb, model);
|
||||
gtk_signal_connect (GTK_OBJECT (tree_view), "button_press_event", GTK_SIGNAL_FUNC (button_press_event_cb), model);
|
||||
gtk_signal_connect (GTK_OBJECT (tree_view), "row_activated", GTK_SIGNAL_FUNC (row_activated_cb), model);
|
||||
|
||||
return tree_view;
|
||||
}
|
||||
|
@ -245,6 +245,7 @@ static gboolean gtk_tree_view_maybe_begin_dragging_row (GtkTreeView *tree_v
|
||||
GdkEventMotion *event);
|
||||
static void _gtk_tree_view_update_col_width (GtkTreeView *tree_view);
|
||||
static void gtk_tree_view_row_activated (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
GtkTreeViewColumn *column);
|
||||
|
||||
static GtkContainerClass *parent_class = NULL;
|
||||
@ -399,8 +400,9 @@ gtk_tree_view_class_init (GtkTreeViewClass *class)
|
||||
GTK_RUN_LAST | GTK_RUN_ACTION,
|
||||
GTK_CLASS_TYPE (object_class),
|
||||
GTK_SIGNAL_OFFSET (GtkTreeViewClass, row_activated),
|
||||
gtk_marshal_VOID__OBJECT,
|
||||
GTK_TYPE_NONE, 1,
|
||||
gtk_marshal_VOID__BOXED_OBJECT,
|
||||
GTK_TYPE_NONE, 2,
|
||||
GTK_TYPE_TREE_PATH,
|
||||
GTK_TYPE_TREE_VIEW_COLUMN);
|
||||
|
||||
}
|
||||
@ -1904,12 +1906,11 @@ gtk_tree_view_button_press (GtkWidget *widget,
|
||||
tree,
|
||||
path,
|
||||
event->state);
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
if (event->button == 1 && event->type == GDK_2BUTTON_PRESS)
|
||||
{
|
||||
gtk_tree_view_row_activated (tree_view, column );
|
||||
}
|
||||
gtk_tree_view_row_activated (tree_view, path, column);
|
||||
|
||||
gtk_tree_path_free (path);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -2688,14 +2689,15 @@ gtk_tree_view_forall (GtkContainer *container,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gtk_tree_view_row_activated (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
GtkTreeViewColumn *column)
|
||||
{
|
||||
g_return_if_fail (tree_view != NULL);
|
||||
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
|
||||
|
||||
g_signal_emit (G_OBJECT(tree_view), tree_view_signals[ROW_ACTIVATED], 0, column);
|
||||
g_signal_emit (G_OBJECT(tree_view), tree_view_signals[ROW_ACTIVATED], 0, path, column);
|
||||
}
|
||||
|
||||
/* TreeModel Callbacks
|
||||
|
@ -75,81 +75,79 @@ struct _GtkTreeViewClass
|
||||
|
||||
};
|
||||
|
||||
GtkType gtk_tree_view_get_type (void);
|
||||
GtkWidget *gtk_tree_view_new (void);
|
||||
GtkWidget *gtk_tree_view_new_with_model (GtkTreeModel *model);
|
||||
|
||||
GtkTreeModel *gtk_tree_view_get_model (GtkTreeView *tree_view);
|
||||
void gtk_tree_view_set_model (GtkTreeView *tree_view,
|
||||
GtkTreeModel *model);
|
||||
GtkTreeSelection *gtk_tree_view_get_selection (GtkTreeView *tree_view);
|
||||
GtkAdjustment *gtk_tree_view_get_hadjustment (GtkTreeView *tree_view);
|
||||
void gtk_tree_view_set_hadjustment (GtkTreeView *tree_view,
|
||||
GtkAdjustment *adjustment);
|
||||
GtkAdjustment *gtk_tree_view_get_vadjustment (GtkTreeView *tree_view);
|
||||
void gtk_tree_view_set_vadjustment (GtkTreeView *tree_view,
|
||||
GtkAdjustment *adjustment);
|
||||
gboolean gtk_tree_view_get_headers_visible (GtkTreeView *tree_view);
|
||||
void gtk_tree_view_set_headers_visible (GtkTreeView *tree_view,
|
||||
gboolean headers_visible);
|
||||
void gtk_tree_view_columns_autosize (GtkTreeView *tree_view);
|
||||
void gtk_tree_view_set_headers_clickable (GtkTreeView *tree_view,
|
||||
gboolean setting);
|
||||
gint gtk_tree_view_append_column (GtkTreeView *tree_view,
|
||||
GtkTreeViewColumn *column);
|
||||
gint gtk_tree_view_remove_column (GtkTreeView *tree_view,
|
||||
GtkTreeViewColumn *column);
|
||||
gint gtk_tree_view_insert_column (GtkTreeView *tree_view,
|
||||
GtkTreeViewColumn *column,
|
||||
gint position);
|
||||
gint gtk_tree_view_insert_column_with_attributes (GtkTreeView *tree_view,
|
||||
gint position,
|
||||
gchar *title,
|
||||
GtkCellRenderer *cell,
|
||||
GtkType gtk_tree_view_get_type (void);
|
||||
GtkWidget *gtk_tree_view_new (void);
|
||||
GtkWidget *gtk_tree_view_new_with_model (GtkTreeModel *model);
|
||||
GtkTreeModel *gtk_tree_view_get_model (GtkTreeView *tree_view);
|
||||
void gtk_tree_view_set_model (GtkTreeView *tree_view,
|
||||
GtkTreeModel *model);
|
||||
GtkTreeSelection *gtk_tree_view_get_selection (GtkTreeView *tree_view);
|
||||
GtkAdjustment *gtk_tree_view_get_hadjustment (GtkTreeView *tree_view);
|
||||
void gtk_tree_view_set_hadjustment (GtkTreeView *tree_view,
|
||||
GtkAdjustment *adjustment);
|
||||
GtkAdjustment *gtk_tree_view_get_vadjustment (GtkTreeView *tree_view);
|
||||
void gtk_tree_view_set_vadjustment (GtkTreeView *tree_view,
|
||||
GtkAdjustment *adjustment);
|
||||
gboolean gtk_tree_view_get_headers_visible (GtkTreeView *tree_view);
|
||||
void gtk_tree_view_set_headers_visible (GtkTreeView *tree_view,
|
||||
gboolean headers_visible);
|
||||
void gtk_tree_view_columns_autosize (GtkTreeView *tree_view);
|
||||
void gtk_tree_view_set_headers_clickable (GtkTreeView *tree_view,
|
||||
gboolean setting);
|
||||
gint gtk_tree_view_append_column (GtkTreeView *tree_view,
|
||||
GtkTreeViewColumn *column);
|
||||
gint gtk_tree_view_remove_column (GtkTreeView *tree_view,
|
||||
GtkTreeViewColumn *column);
|
||||
gint gtk_tree_view_insert_column (GtkTreeView *tree_view,
|
||||
GtkTreeViewColumn *column,
|
||||
gint position);
|
||||
gint gtk_tree_view_insert_column_with_attributes (GtkTreeView *tree_view,
|
||||
gint position,
|
||||
gchar *title,
|
||||
GtkCellRenderer *cell,
|
||||
...);
|
||||
GtkTreeViewColumn *gtk_tree_view_get_column (GtkTreeView *tree_view,
|
||||
gint n);
|
||||
void gtk_tree_view_set_expander_column (GtkTreeView *tree_view,
|
||||
gint col);
|
||||
gint gtk_tree_view_get_expander_column (GtkTreeView *tree_view);
|
||||
|
||||
GtkTreeViewColumn *gtk_tree_view_get_column (GtkTreeView *tree_view,
|
||||
gint n);
|
||||
|
||||
void gtk_tree_view_set_expander_column (GtkTreeView *tree_view,
|
||||
gint col);
|
||||
|
||||
gint gtk_tree_view_get_expander_column (GtkTreeView *tree_view);
|
||||
|
||||
/* Actions */
|
||||
void gtk_tree_view_scroll_to_point (GtkTreeView *tree_view,
|
||||
gint tree_x,
|
||||
gint tree_y);
|
||||
|
||||
void gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
GtkTreeViewColumn *column,
|
||||
gfloat row_align,
|
||||
gfloat col_align);
|
||||
gboolean gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view,
|
||||
GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
GtkTreePath **path,
|
||||
GtkTreeViewColumn **column,
|
||||
gint *cell_x,
|
||||
gint *cell_y);
|
||||
void gtk_tree_view_get_cell_area (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
GtkTreeViewColumn *column,
|
||||
GdkRectangle *rect);
|
||||
void gtk_tree_view_get_background_area (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
GtkTreeViewColumn *column,
|
||||
GdkRectangle *rect);
|
||||
|
||||
void gtk_tree_view_expand_all (GtkTreeView *tree_view);
|
||||
void gtk_tree_view_collapse_all (GtkTreeView *tree_view);
|
||||
gboolean gtk_tree_view_expand_row (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
gboolean open_all);
|
||||
gboolean gtk_tree_view_collapse_row (GtkTreeView *tree_view,
|
||||
GtkTreePath *path);
|
||||
void gtk_tree_view_scroll_to_point (GtkTreeView *tree_view,
|
||||
gint tree_x,
|
||||
gint tree_y);
|
||||
void gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
GtkTreeViewColumn *column,
|
||||
gfloat row_align,
|
||||
gfloat col_align);
|
||||
gboolean gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view,
|
||||
GdkWindow *window,
|
||||
gint x,
|
||||
gint y,
|
||||
GtkTreePath **path,
|
||||
GtkTreeViewColumn **column,
|
||||
gint *cell_x,
|
||||
gint *cell_y);
|
||||
void gtk_tree_view_get_cell_area (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
GtkTreeViewColumn *column,
|
||||
GdkRectangle *rect);
|
||||
void gtk_tree_view_get_background_area (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
GtkTreeViewColumn *column,
|
||||
GdkRectangle *rect);
|
||||
void gtk_tree_view_expand_all (GtkTreeView *tree_view);
|
||||
void gtk_tree_view_collapse_all (GtkTreeView *tree_view);
|
||||
gboolean gtk_tree_view_expand_row (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
gboolean open_all);
|
||||
gboolean gtk_tree_view_collapse_row (GtkTreeView *tree_view,
|
||||
GtkTreePath *path);
|
||||
void gtk_tree_view_row_activated (GtkTreeView *tree_view,
|
||||
GtkTreePath *path,
|
||||
GtkTreeViewColumn *column);
|
||||
|
||||
void gtk_tree_view_get_visible_rect (GtkTreeView *tree_view,
|
||||
GdkRectangle *visible_rect);
|
||||
|
Loading…
Reference in New Issue
Block a user