1997-11-24 22:37:52 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
1998-04-13 02:02:47 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
|
|
|
#include "gtklabel.h"
|
1997-12-17 23:41:42 +00:00
|
|
|
#include "gtktree.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
#include "gtktreeitem.h"
|
1997-12-17 23:41:42 +00:00
|
|
|
#include "gtkeventbox.h"
|
|
|
|
#include "gtkpixmap.h"
|
|
|
|
#include "gtkmain.h"
|
|
|
|
#include "gtksignal.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-02-21 14:11:40 +00:00
|
|
|
#include "tree_plus.xpm"
|
|
|
|
#include "tree_minus.xpm"
|
1997-12-17 23:41:42 +00:00
|
|
|
|
|
|
|
#define DEFAULT_DELTA 9
|
|
|
|
|
|
|
|
enum {
|
|
|
|
COLLAPSE_TREE,
|
|
|
|
EXPAND_TREE,
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
1998-03-05 06:32:42 +00:00
|
|
|
typedef struct _GtkTreePixmaps GtkTreePixmaps;
|
|
|
|
|
|
|
|
struct _GtkTreePixmaps {
|
|
|
|
gint refcount;
|
|
|
|
GdkColormap *colormap;
|
|
|
|
|
|
|
|
GdkPixmap *pixmap_plus;
|
|
|
|
GdkPixmap *pixmap_minus;
|
|
|
|
GdkBitmap *mask_plus;
|
|
|
|
GdkBitmap *mask_minus;
|
|
|
|
};
|
|
|
|
|
|
|
|
static GList *pixmaps = NULL;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void gtk_tree_item_class_init (GtkTreeItemClass *klass);
|
|
|
|
static void gtk_tree_item_init (GtkTreeItem *tree_item);
|
1997-12-17 23:41:42 +00:00
|
|
|
static void gtk_tree_item_realize (GtkWidget *widget);
|
|
|
|
static void gtk_tree_item_size_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition);
|
|
|
|
static void gtk_tree_item_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation);
|
|
|
|
static void gtk_tree_item_draw (GtkWidget *widget,
|
|
|
|
GdkRectangle *area);
|
|
|
|
static void gtk_tree_item_draw_focus (GtkWidget *widget);
|
|
|
|
static gint gtk_tree_item_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event);
|
|
|
|
static gint gtk_tree_item_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event);
|
|
|
|
static gint gtk_tree_item_focus_in (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event);
|
|
|
|
static gint gtk_tree_item_focus_out (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event);
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
static void gtk_tree_item_forall (GtkContainer *container,
|
|
|
|
gboolean include_internals,
|
|
|
|
GtkCallback callback,
|
|
|
|
gpointer callback_data);
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
static void gtk_real_tree_item_select (GtkItem *item);
|
|
|
|
static void gtk_real_tree_item_deselect (GtkItem *item);
|
|
|
|
static void gtk_real_tree_item_toggle (GtkItem *item);
|
|
|
|
static void gtk_real_tree_item_expand (GtkTreeItem *item);
|
|
|
|
static void gtk_real_tree_item_collapse (GtkTreeItem *item);
|
|
|
|
static void gtk_real_tree_item_expand (GtkTreeItem *item);
|
|
|
|
static void gtk_real_tree_item_collapse (GtkTreeItem *item);
|
|
|
|
static void gtk_tree_item_destroy (GtkObject *object);
|
|
|
|
static void gtk_tree_item_subtree_button_click (GtkWidget *widget);
|
|
|
|
static void gtk_tree_item_subtree_button_changed_state (GtkWidget *widget);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
static void gtk_tree_item_map(GtkWidget*);
|
|
|
|
static void gtk_tree_item_unmap(GtkWidget*);
|
|
|
|
|
1998-03-05 06:32:42 +00:00
|
|
|
static void gtk_tree_item_add_pixmaps (GtkTreeItem *tree_item);
|
|
|
|
static void gtk_tree_item_remove_pixmaps (GtkTreeItem *tree_item);
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
static GtkItemClass *parent_class = NULL;
|
1998-03-09 15:16:28 +00:00
|
|
|
static guint tree_item_signals[LAST_SIGNAL] = { 0 };
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-06-16 05:20:05 +00:00
|
|
|
GtkType
|
1998-05-03 22:41:32 +00:00
|
|
|
gtk_tree_item_get_type (void)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-06-16 05:20:05 +00:00
|
|
|
static GtkType tree_item_type = 0;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (!tree_item_type)
|
|
|
|
{
|
1998-11-30 19:07:15 +00:00
|
|
|
static const GtkTypeInfo tree_item_info =
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
"GtkTreeItem",
|
|
|
|
sizeof (GtkTreeItem),
|
|
|
|
sizeof (GtkTreeItemClass),
|
|
|
|
(GtkClassInitFunc) gtk_tree_item_class_init,
|
|
|
|
(GtkObjectInitFunc) gtk_tree_item_init,
|
1998-07-04 15:31:30 +00:00
|
|
|
/* reserved_1 */ NULL,
|
|
|
|
/* reserved_2 */ NULL,
|
1998-06-28 07:46:10 +00:00
|
|
|
(GtkClassInitFunc) NULL,
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
tree_item_type = gtk_type_unique (gtk_item_get_type (), &tree_item_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
return tree_item_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_item_class_init (GtkTreeItemClass *class)
|
|
|
|
{
|
1997-12-17 23:41:42 +00:00
|
|
|
GtkObjectClass *object_class;
|
|
|
|
GtkWidgetClass *widget_class;
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
GtkContainerClass *container_class;
|
1997-12-17 23:41:42 +00:00
|
|
|
GtkItemClass *item_class;
|
|
|
|
|
|
|
|
object_class = (GtkObjectClass*) class;
|
|
|
|
widget_class = (GtkWidgetClass*) class;
|
|
|
|
item_class = (GtkItemClass*) class;
|
|
|
|
container_class = (GtkContainerClass*) class;
|
|
|
|
|
|
|
|
parent_class = gtk_type_class (gtk_item_get_type ());
|
|
|
|
|
|
|
|
tree_item_signals[EXPAND_TREE] =
|
|
|
|
gtk_signal_new ("expand",
|
|
|
|
GTK_RUN_FIRST,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkTreeItemClass, expand),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__NONE,
|
1997-12-17 23:41:42 +00:00
|
|
|
GTK_TYPE_NONE, 0);
|
|
|
|
tree_item_signals[COLLAPSE_TREE] =
|
|
|
|
gtk_signal_new ("collapse",
|
|
|
|
GTK_RUN_FIRST,
|
|
|
|
object_class->type,
|
|
|
|
GTK_SIGNAL_OFFSET (GtkTreeItemClass, collapse),
|
1998-07-21 04:13:42 +00:00
|
|
|
gtk_marshal_NONE__NONE,
|
1997-12-17 23:41:42 +00:00
|
|
|
GTK_TYPE_NONE, 0);
|
|
|
|
|
|
|
|
gtk_object_class_add_signals (object_class, tree_item_signals, LAST_SIGNAL);
|
|
|
|
|
|
|
|
object_class->destroy = gtk_tree_item_destroy;
|
|
|
|
|
|
|
|
widget_class->realize = gtk_tree_item_realize;
|
|
|
|
widget_class->size_request = gtk_tree_item_size_request;
|
|
|
|
widget_class->size_allocate = gtk_tree_item_size_allocate;
|
|
|
|
widget_class->draw = gtk_tree_item_draw;
|
|
|
|
widget_class->draw_focus = gtk_tree_item_draw_focus;
|
|
|
|
widget_class->button_press_event = gtk_tree_item_button_press;
|
|
|
|
widget_class->expose_event = gtk_tree_item_expose;
|
|
|
|
widget_class->focus_in_event = gtk_tree_item_focus_in;
|
|
|
|
widget_class->focus_out_event = gtk_tree_item_focus_out;
|
|
|
|
widget_class->map = gtk_tree_item_map;
|
|
|
|
widget_class->unmap = gtk_tree_item_unmap;
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
container_class->forall = gtk_tree_item_forall;
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
item_class->select = gtk_real_tree_item_select;
|
|
|
|
item_class->deselect = gtk_real_tree_item_deselect;
|
|
|
|
item_class->toggle = gtk_real_tree_item_toggle;
|
|
|
|
|
|
|
|
class->expand = gtk_real_tree_item_expand;
|
|
|
|
class->collapse = gtk_real_tree_item_collapse;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* callback for event box mouse event */
|
|
|
|
static void
|
|
|
|
gtk_tree_item_subtree_button_click (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkTreeItem* item;
|
1998-03-11 04:05:15 +00:00
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_EVENT_BOX (widget));
|
|
|
|
|
|
|
|
item = (GtkTreeItem*) gtk_object_get_user_data (GTK_OBJECT (widget));
|
|
|
|
if (!GTK_WIDGET_IS_SENSITIVE (item))
|
1998-01-27 03:57:59 +00:00
|
|
|
return;
|
1998-03-11 04:05:15 +00:00
|
|
|
|
|
|
|
if (item->expanded)
|
|
|
|
gtk_tree_item_collapse (item);
|
1997-12-17 23:41:42 +00:00
|
|
|
else
|
1998-03-11 04:05:15 +00:00
|
|
|
gtk_tree_item_expand (item);
|
1997-12-17 23:41:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* callback for event box state changed */
|
|
|
|
static void
|
1998-03-11 04:05:15 +00:00
|
|
|
gtk_tree_item_subtree_button_changed_state (GtkWidget *widget)
|
1997-12-17 23:41:42 +00:00
|
|
|
{
|
1998-03-11 04:05:15 +00:00
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_EVENT_BOX (widget));
|
|
|
|
|
|
|
|
if (GTK_WIDGET_VISIBLE (widget))
|
|
|
|
{
|
|
|
|
|
|
|
|
if (widget->state == GTK_STATE_NORMAL)
|
|
|
|
gdk_window_set_background (widget->window, &widget->style->base[widget->state]);
|
|
|
|
else
|
|
|
|
gdk_window_set_background (widget->window, &widget->style->bg[widget->state]);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_DRAWABLE (widget))
|
|
|
|
gdk_window_clear_area (widget->window, 0, 0,
|
|
|
|
widget->allocation.width, widget->allocation.height);
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_item_init (GtkTreeItem *tree_item)
|
|
|
|
{
|
1997-12-17 23:41:42 +00:00
|
|
|
GtkWidget *eventbox, *pixmapwid;
|
1998-03-02 02:00:30 +00:00
|
|
|
|
1998-03-11 04:05:15 +00:00
|
|
|
g_return_if_fail (tree_item != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (tree_item));
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
tree_item->expanded = FALSE;
|
|
|
|
tree_item->subtree = NULL;
|
|
|
|
GTK_WIDGET_SET_FLAGS (tree_item, GTK_CAN_FOCUS);
|
|
|
|
|
1998-03-02 02:00:30 +00:00
|
|
|
/* create an event box containing one pixmaps */
|
|
|
|
eventbox = gtk_event_box_new();
|
|
|
|
gtk_widget_set_events (eventbox, GDK_BUTTON_PRESS_MASK);
|
|
|
|
gtk_signal_connect(GTK_OBJECT(eventbox), "state_changed",
|
|
|
|
(GtkSignalFunc)gtk_tree_item_subtree_button_changed_state,
|
|
|
|
(gpointer)NULL);
|
|
|
|
gtk_signal_connect(GTK_OBJECT(eventbox), "realize",
|
|
|
|
(GtkSignalFunc)gtk_tree_item_subtree_button_changed_state,
|
|
|
|
(gpointer)NULL);
|
|
|
|
gtk_signal_connect(GTK_OBJECT(eventbox), "button_press_event",
|
|
|
|
(GtkSignalFunc)gtk_tree_item_subtree_button_click,
|
|
|
|
(gpointer)NULL);
|
|
|
|
gtk_object_set_user_data(GTK_OBJECT(eventbox), tree_item);
|
|
|
|
tree_item->pixmaps_box = eventbox;
|
|
|
|
|
|
|
|
/* create pixmap for button '+' */
|
|
|
|
pixmapwid = gtk_type_new (gtk_pixmap_get_type ());
|
|
|
|
if (!tree_item->expanded)
|
|
|
|
gtk_container_add (GTK_CONTAINER (eventbox), pixmapwid);
|
|
|
|
gtk_widget_show (pixmapwid);
|
|
|
|
tree_item->plus_pix_widget = pixmapwid;
|
|
|
|
gtk_widget_ref (tree_item->plus_pix_widget);
|
|
|
|
gtk_object_sink (GTK_OBJECT (tree_item->plus_pix_widget));
|
|
|
|
|
|
|
|
/* create pixmap for button '-' */
|
|
|
|
pixmapwid = gtk_type_new (gtk_pixmap_get_type ());
|
|
|
|
if (tree_item->expanded)
|
|
|
|
gtk_container_add (GTK_CONTAINER (eventbox), pixmapwid);
|
|
|
|
gtk_widget_show (pixmapwid);
|
|
|
|
tree_item->minus_pix_widget = pixmapwid;
|
|
|
|
gtk_widget_ref (tree_item->minus_pix_widget);
|
|
|
|
gtk_object_sink (GTK_OBJECT (tree_item->minus_pix_widget));
|
|
|
|
|
|
|
|
gtk_widget_set_parent (eventbox, GTK_WIDGET (tree_item));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GtkWidget*
|
1998-05-03 22:41:32 +00:00
|
|
|
gtk_tree_item_new (void)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1997-12-17 23:41:42 +00:00
|
|
|
GtkWidget *tree_item;
|
|
|
|
|
|
|
|
tree_item = GTK_WIDGET (gtk_type_new (gtk_tree_item_get_type ()));
|
|
|
|
|
|
|
|
return tree_item;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget*
|
|
|
|
gtk_tree_item_new_with_label (gchar *label)
|
|
|
|
{
|
|
|
|
GtkWidget *tree_item;
|
|
|
|
GtkWidget *label_widget;
|
|
|
|
|
|
|
|
tree_item = gtk_tree_item_new ();
|
|
|
|
label_widget = gtk_label_new (label);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5);
|
|
|
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (tree_item), label_widget);
|
|
|
|
gtk_widget_show (label_widget);
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
return tree_item;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_tree_item_set_subtree (GtkTreeItem *tree_item,
|
|
|
|
GtkWidget *subtree)
|
|
|
|
{
|
|
|
|
g_return_if_fail (tree_item != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (tree_item));
|
1998-03-11 04:05:15 +00:00
|
|
|
g_return_if_fail (subtree != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE (subtree));
|
1997-12-17 23:41:42 +00:00
|
|
|
|
|
|
|
if(tree_item->subtree) {
|
|
|
|
g_warning("there is already a subtree for this tree item\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
tree_item->subtree = subtree;
|
|
|
|
GTK_TREE(subtree)->tree_owner = GTK_WIDGET(tree_item);
|
|
|
|
|
|
|
|
/* show subtree button */
|
1998-03-02 02:00:30 +00:00
|
|
|
if (tree_item->pixmaps_box)
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
gtk_widget_show (tree_item->pixmaps_box);
|
1997-12-17 23:41:42 +00:00
|
|
|
|
|
|
|
/* set parent widget */
|
|
|
|
gtk_widget_set_parent(subtree, GTK_WIDGET(tree_item)->parent);
|
|
|
|
|
|
|
|
if(GTK_WIDGET_VISIBLE(GTK_WIDGET(tree_item)))
|
|
|
|
{
|
|
|
|
if(GTK_WIDGET_REALIZED (GTK_WIDGET(tree_item)) &&
|
|
|
|
!GTK_WIDGET_REALIZED (GTK_WIDGET(subtree)))
|
|
|
|
gtk_widget_realize (GTK_WIDGET(subtree));
|
|
|
|
|
|
|
|
if(GTK_WIDGET_MAPPED (GTK_WIDGET(tree_item)) &&
|
|
|
|
!GTK_WIDGET_MAPPED (GTK_WIDGET(subtree)))
|
|
|
|
gtk_widget_map (GTK_WIDGET(subtree));
|
|
|
|
}
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
if (tree_item->expanded)
|
1997-12-17 23:41:42 +00:00
|
|
|
gtk_widget_show(subtree);
|
|
|
|
else
|
|
|
|
gtk_widget_hide(subtree);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_VISIBLE (tree_item) && GTK_WIDGET_VISIBLE (tree_item))
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET(tree_item));
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_tree_item_select (GtkTreeItem *tree_item)
|
|
|
|
{
|
1998-03-11 04:05:15 +00:00
|
|
|
g_return_if_fail (tree_item != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (tree_item));
|
1997-12-17 23:41:42 +00:00
|
|
|
|
|
|
|
gtk_item_select (GTK_ITEM (tree_item));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_tree_item_deselect (GtkTreeItem *tree_item)
|
|
|
|
{
|
1998-03-11 04:05:15 +00:00
|
|
|
g_return_if_fail (tree_item != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (tree_item));
|
1997-12-17 23:41:42 +00:00
|
|
|
|
|
|
|
gtk_item_deselect (GTK_ITEM (tree_item));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_tree_item_expand (GtkTreeItem *tree_item)
|
|
|
|
{
|
1998-03-11 04:05:15 +00:00
|
|
|
g_return_if_fail (tree_item != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (tree_item));
|
1997-12-17 23:41:42 +00:00
|
|
|
|
|
|
|
gtk_signal_emit (GTK_OBJECT (tree_item), tree_item_signals[EXPAND_TREE], NULL);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_tree_item_collapse (GtkTreeItem *tree_item)
|
|
|
|
{
|
1998-03-11 04:05:15 +00:00
|
|
|
g_return_if_fail (tree_item != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (tree_item));
|
1997-12-17 23:41:42 +00:00
|
|
|
|
|
|
|
gtk_signal_emit (GTK_OBJECT (tree_item), tree_item_signals[COLLAPSE_TREE], NULL);
|
|
|
|
}
|
|
|
|
|
1998-03-05 06:32:42 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_item_add_pixmaps (GtkTreeItem *tree_item)
|
1998-03-02 02:00:30 +00:00
|
|
|
{
|
1998-03-05 06:32:42 +00:00
|
|
|
GList *tmp_list;
|
|
|
|
GdkColormap *colormap;
|
|
|
|
GtkTreePixmaps *pixmap_node = NULL;
|
|
|
|
|
1998-03-11 04:05:15 +00:00
|
|
|
g_return_if_fail (tree_item != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (tree_item));
|
|
|
|
|
1998-03-05 06:32:42 +00:00
|
|
|
if (tree_item->pixmaps)
|
|
|
|
return;
|
|
|
|
|
|
|
|
colormap = gtk_widget_get_colormap (GTK_WIDGET (tree_item));
|
|
|
|
|
|
|
|
tmp_list = pixmaps;
|
|
|
|
while (tmp_list)
|
|
|
|
{
|
|
|
|
pixmap_node = (GtkTreePixmaps *)tmp_list->data;
|
|
|
|
|
|
|
|
if (pixmap_node->colormap == colormap)
|
|
|
|
break;
|
|
|
|
|
|
|
|
tmp_list = tmp_list->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tmp_list)
|
|
|
|
{
|
|
|
|
pixmap_node->refcount++;
|
|
|
|
tree_item->pixmaps = tmp_list;
|
|
|
|
}
|
|
|
|
else
|
1998-03-02 02:00:30 +00:00
|
|
|
{
|
1998-03-05 06:32:42 +00:00
|
|
|
pixmap_node = g_new (GtkTreePixmaps, 1);
|
|
|
|
|
|
|
|
pixmap_node->colormap = colormap;
|
1998-03-08 21:47:14 +00:00
|
|
|
gdk_colormap_ref (colormap);
|
|
|
|
|
1998-03-05 06:32:42 +00:00
|
|
|
pixmap_node->refcount = 1;
|
|
|
|
|
1998-03-02 02:00:30 +00:00
|
|
|
/* create pixmaps for plus icon */
|
1998-03-05 06:32:42 +00:00
|
|
|
pixmap_node->pixmap_plus =
|
|
|
|
gdk_pixmap_create_from_xpm_d (GTK_WIDGET (tree_item)->window,
|
|
|
|
&pixmap_node->mask_plus,
|
|
|
|
NULL,
|
|
|
|
tree_plus);
|
1998-03-02 02:00:30 +00:00
|
|
|
|
|
|
|
/* create pixmaps for minus icon */
|
1998-03-05 06:32:42 +00:00
|
|
|
pixmap_node->pixmap_minus =
|
|
|
|
gdk_pixmap_create_from_xpm_d (GTK_WIDGET (tree_item)->window,
|
|
|
|
&pixmap_node->mask_minus,
|
|
|
|
NULL,
|
|
|
|
tree_minus);
|
|
|
|
|
|
|
|
tree_item->pixmaps = pixmaps = g_list_prepend (pixmaps, pixmap_node);
|
1998-03-02 02:00:30 +00:00
|
|
|
}
|
1998-03-05 06:32:42 +00:00
|
|
|
|
|
|
|
gtk_pixmap_set (GTK_PIXMAP (tree_item->plus_pix_widget),
|
|
|
|
pixmap_node->pixmap_plus, pixmap_node->mask_plus);
|
|
|
|
gtk_pixmap_set (GTK_PIXMAP (tree_item->minus_pix_widget),
|
|
|
|
pixmap_node->pixmap_minus, pixmap_node->mask_minus);
|
|
|
|
}
|
1998-03-02 02:00:30 +00:00
|
|
|
|
1998-03-05 06:32:42 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_item_remove_pixmaps (GtkTreeItem *tree_item)
|
|
|
|
{
|
1998-03-11 04:05:15 +00:00
|
|
|
g_return_if_fail (tree_item != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (tree_item));
|
|
|
|
|
1998-03-05 06:32:42 +00:00
|
|
|
if (tree_item->pixmaps)
|
|
|
|
{
|
|
|
|
GtkTreePixmaps *pixmap_node = (GtkTreePixmaps *)tree_item->pixmaps->data;
|
|
|
|
|
|
|
|
g_assert (pixmap_node->refcount > 0);
|
|
|
|
|
|
|
|
if (--pixmap_node->refcount == 0)
|
|
|
|
{
|
1998-03-08 21:47:14 +00:00
|
|
|
gdk_colormap_unref (pixmap_node->colormap);
|
1998-03-05 06:32:42 +00:00
|
|
|
gdk_pixmap_unref (pixmap_node->pixmap_plus);
|
|
|
|
gdk_bitmap_unref (pixmap_node->mask_plus);
|
|
|
|
gdk_pixmap_unref (pixmap_node->pixmap_minus);
|
|
|
|
gdk_bitmap_unref (pixmap_node->mask_minus);
|
|
|
|
|
|
|
|
pixmaps = g_list_remove_link (pixmaps, tree_item->pixmaps);
|
|
|
|
g_list_free_1 (tree_item->pixmaps);
|
|
|
|
g_free (pixmap_node);
|
|
|
|
}
|
|
|
|
|
|
|
|
tree_item->pixmaps = NULL;
|
|
|
|
}
|
1998-03-02 02:00:30 +00:00
|
|
|
}
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_item_realize (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (widget));
|
|
|
|
|
|
|
|
if (GTK_WIDGET_CLASS (parent_class)->realize)
|
|
|
|
(* GTK_WIDGET_CLASS (parent_class)->realize) (widget);
|
|
|
|
|
1998-02-13 05:26:33 +00:00
|
|
|
gdk_window_set_background (widget->window,
|
|
|
|
&widget->style->base[GTK_STATE_NORMAL]);
|
1998-03-02 02:00:30 +00:00
|
|
|
|
1998-03-05 06:32:42 +00:00
|
|
|
gtk_tree_item_add_pixmaps (GTK_TREE_ITEM (widget));
|
1997-12-17 23:41:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_item_size_request (GtkWidget *widget,
|
|
|
|
GtkRequisition *requisition)
|
|
|
|
{
|
|
|
|
GtkBin *bin;
|
|
|
|
GtkTreeItem* item;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (widget));
|
|
|
|
g_return_if_fail (requisition != NULL);
|
|
|
|
|
|
|
|
bin = GTK_BIN (widget);
|
|
|
|
item = GTK_TREE_ITEM(widget);
|
|
|
|
|
|
|
|
requisition->width = (GTK_CONTAINER (widget)->border_width +
|
|
|
|
widget->style->klass->xthickness) * 2;
|
|
|
|
requisition->height = GTK_CONTAINER (widget)->border_width * 2;
|
|
|
|
|
|
|
|
if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
|
|
|
|
{
|
|
|
|
gtk_widget_size_request (bin->child, &bin->child->requisition);
|
|
|
|
|
|
|
|
requisition->width += bin->child->requisition.width;
|
|
|
|
|
|
|
|
gtk_widget_size_request (item->pixmaps_box,
|
|
|
|
&item->pixmaps_box->requisition);
|
|
|
|
requisition->width += item->pixmaps_box->requisition.width + DEFAULT_DELTA +
|
|
|
|
GTK_TREE(widget->parent)->current_indent;
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
requisition->height += MAX (bin->child->requisition.height,
|
|
|
|
item->pixmaps_box->requisition.height);
|
1997-12-17 23:41:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_item_size_allocate (GtkWidget *widget,
|
|
|
|
GtkAllocation *allocation)
|
|
|
|
{
|
|
|
|
GtkBin *bin;
|
|
|
|
GtkTreeItem* item;
|
|
|
|
GtkAllocation child_allocation;
|
|
|
|
guint border_width;
|
1997-12-19 05:41:45 +00:00
|
|
|
int temp;
|
1997-12-17 23:41:42 +00:00
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (widget));
|
|
|
|
g_return_if_fail (allocation != NULL);
|
|
|
|
|
|
|
|
widget->allocation = *allocation;
|
|
|
|
if (GTK_WIDGET_REALIZED (widget))
|
|
|
|
gdk_window_move_resize (widget->window,
|
|
|
|
allocation->x, allocation->y,
|
|
|
|
allocation->width, allocation->height);
|
|
|
|
|
|
|
|
bin = GTK_BIN (widget);
|
|
|
|
item = GTK_TREE_ITEM(widget);
|
|
|
|
|
|
|
|
if (bin->child)
|
|
|
|
{
|
|
|
|
border_width = (GTK_CONTAINER (widget)->border_width +
|
|
|
|
widget->style->klass->xthickness);
|
|
|
|
|
|
|
|
child_allocation.x = border_width + GTK_TREE(widget->parent)->current_indent;
|
|
|
|
child_allocation.y = GTK_CONTAINER (widget)->border_width;
|
|
|
|
|
1997-12-19 05:41:45 +00:00
|
|
|
child_allocation.width = item->pixmaps_box->requisition.width;
|
|
|
|
child_allocation.height = item->pixmaps_box->requisition.height;
|
|
|
|
|
|
|
|
temp = allocation->height - child_allocation.height;
|
|
|
|
child_allocation.y += ( temp / 2 ) + ( temp % 2 );
|
|
|
|
|
|
|
|
gtk_widget_size_allocate (item->pixmaps_box, &child_allocation);
|
|
|
|
|
|
|
|
child_allocation.y = GTK_CONTAINER (widget)->border_width;
|
1999-01-14 06:04:55 +00:00
|
|
|
child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2);
|
1997-12-17 23:41:42 +00:00
|
|
|
child_allocation.x += item->pixmaps_box->requisition.width+DEFAULT_DELTA;
|
|
|
|
|
|
|
|
child_allocation.width =
|
1999-01-14 06:04:55 +00:00
|
|
|
MAX (1, (gint)allocation->width - ((gint)child_allocation.x + border_width));
|
1997-12-17 23:41:42 +00:00
|
|
|
|
|
|
|
gtk_widget_size_allocate (bin->child, &child_allocation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-12-19 05:41:45 +00:00
|
|
|
static void
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
gtk_tree_item_draw_lines (GtkWidget *widget)
|
1997-12-19 05:41:45 +00:00
|
|
|
{
|
|
|
|
GtkTreeItem* item;
|
|
|
|
GtkTree* tree;
|
|
|
|
guint lx1, ly1, lx2, ly2;
|
|
|
|
|
1998-03-11 04:05:15 +00:00
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (widget));
|
|
|
|
|
1997-12-19 05:41:45 +00:00
|
|
|
item = GTK_TREE_ITEM(widget);
|
|
|
|
tree = GTK_TREE(widget->parent);
|
|
|
|
|
|
|
|
/* draw vertical line */
|
|
|
|
lx1 = item->pixmaps_box->allocation.width;
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
lx1 = lx2 = ((lx1 / 2) + (lx1 % 2) +
|
|
|
|
GTK_CONTAINER (widget)->border_width + 1 + tree->current_indent);
|
1997-12-19 05:41:45 +00:00
|
|
|
ly1 = 0;
|
|
|
|
ly2 = widget->allocation.height;
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
if (g_list_last (tree->children)->data == widget)
|
1997-12-19 05:41:45 +00:00
|
|
|
ly2 = (ly2 / 2) + (ly2 % 2);
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
if (tree != tree->root_tree)
|
|
|
|
gdk_draw_line (widget->window, widget->style->black_gc, lx1, ly1, lx2, ly2);
|
1997-12-19 05:41:45 +00:00
|
|
|
|
|
|
|
/* draw vertical line for subtree connecting */
|
|
|
|
if(g_list_last(tree->children)->data != (gpointer)widget)
|
|
|
|
ly2 = (ly2 / 2) + (ly2 % 2);
|
|
|
|
|
|
|
|
lx2 += DEFAULT_DELTA;
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
if (item->subtree && item->expanded)
|
|
|
|
gdk_draw_line (widget->window, widget->style->black_gc,
|
|
|
|
lx2, ly2, lx2, widget->allocation.height);
|
1997-12-19 05:41:45 +00:00
|
|
|
|
|
|
|
/* draw horizontal line */
|
|
|
|
ly1 = ly2;
|
|
|
|
lx2 += 2;
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
gdk_draw_line (widget->window, widget->style->black_gc,
|
|
|
|
lx1, ly1, lx2, ly2);
|
1997-12-19 05:41:45 +00:00
|
|
|
|
|
|
|
lx2 -= DEFAULT_DELTA+2;
|
|
|
|
ly1 = 0;
|
|
|
|
ly2 = widget->allocation.height;
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
if (tree != tree->root_tree)
|
1997-12-19 05:41:45 +00:00
|
|
|
{
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
item = GTK_TREE_ITEM (tree->tree_owner);
|
|
|
|
tree = GTK_TREE (GTK_WIDGET (tree)->parent);
|
|
|
|
while (tree != tree->root_tree)
|
|
|
|
{
|
|
|
|
lx1 = lx2 -= tree->indent_value;
|
|
|
|
|
|
|
|
if (g_list_last (tree->children)->data != item)
|
|
|
|
gdk_draw_line (widget->window, widget->style->black_gc, lx1, ly1, lx2, ly2);
|
|
|
|
item = GTK_TREE_ITEM (tree->tree_owner);
|
|
|
|
tree = GTK_TREE (GTK_WIDGET (tree)->parent);
|
|
|
|
}
|
1997-12-19 05:41:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_item_draw (GtkWidget *widget,
|
|
|
|
GdkRectangle *area)
|
|
|
|
{
|
|
|
|
GtkBin *bin;
|
|
|
|
GdkRectangle child_area, item_area;
|
|
|
|
GtkTreeItem* tree_item;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (widget));
|
|
|
|
g_return_if_fail (area != NULL);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_DRAWABLE (widget))
|
|
|
|
{
|
|
|
|
bin = GTK_BIN (widget);
|
|
|
|
tree_item = GTK_TREE_ITEM(widget);
|
|
|
|
|
|
|
|
/* draw left size of tree item */
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
item_area.x = 0;
|
|
|
|
item_area.y = 0;
|
|
|
|
item_area.width = (tree_item->pixmaps_box->allocation.width + DEFAULT_DELTA +
|
|
|
|
GTK_TREE (widget->parent)->current_indent + 2);
|
1997-12-17 23:41:42 +00:00
|
|
|
item_area.height = widget->allocation.height;
|
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
if (gdk_rectangle_intersect(&item_area, area, &child_area))
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
{
|
1998-11-06 22:05:02 +00:00
|
|
|
if (widget->state == GTK_STATE_NORMAL)
|
|
|
|
{
|
|
|
|
gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
|
|
|
|
gdk_window_clear_area (widget->window, area->x, area->y, area->width, area->height);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (!GTK_WIDGET_IS_SENSITIVE (widget))
|
|
|
|
gtk_paint_flat_box(widget->style, widget->window,
|
|
|
|
widget->state, GTK_STATE_INSENSITIVE,
|
|
|
|
area, widget, "treeitem",
|
|
|
|
0, 0, -1, -1);
|
|
|
|
else
|
|
|
|
gtk_paint_flat_box(widget->style, widget->window,
|
|
|
|
widget->state, GTK_SHADOW_ETCHED_OUT,
|
|
|
|
area, widget, "treeitem",
|
|
|
|
0, 0, -1, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_tree_item_draw_lines(widget);
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
|
|
|
|
if (tree_item->pixmaps_box &&
|
|
|
|
GTK_WIDGET_VISIBLE(tree_item->pixmaps_box) &&
|
|
|
|
gtk_widget_intersect (tree_item->pixmaps_box, area, &child_area))
|
|
|
|
gtk_widget_draw (tree_item->pixmaps_box, &child_area);
|
|
|
|
}
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
/* draw right side */
|
1998-11-06 22:05:02 +00:00
|
|
|
if (gtk_widget_intersect (bin->child, area, &child_area))
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
{
|
1998-11-06 22:05:02 +00:00
|
|
|
if (bin->child &&
|
|
|
|
GTK_WIDGET_VISIBLE(bin->child) &&
|
|
|
|
gtk_widget_intersect (bin->child, area, &child_area))
|
|
|
|
gtk_widget_draw (bin->child, &child_area);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GTK_WIDGET_HAS_FOCUS (widget))
|
|
|
|
gtk_paint_focus (widget->style, widget->window,
|
|
|
|
NULL, widget, "treeitem",
|
|
|
|
0, 0,
|
|
|
|
widget->allocation.width - 1,
|
|
|
|
widget->allocation.height - 1);
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_item_draw_focus (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (widget));
|
|
|
|
|
1998-11-06 22:05:02 +00:00
|
|
|
gtk_widget_draw(widget, NULL);
|
1997-12-17 23:41:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_tree_item_button_press (GtkWidget *widget,
|
|
|
|
GdkEventButton *event)
|
|
|
|
{
|
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_ITEM (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
1998-01-27 03:57:59 +00:00
|
|
|
if (event->type == GDK_BUTTON_PRESS
|
|
|
|
&& GTK_WIDGET_IS_SENSITIVE(widget)
|
|
|
|
&& !GTK_WIDGET_HAS_FOCUS (widget))
|
1997-12-17 23:41:42 +00:00
|
|
|
gtk_widget_grab_focus (widget);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_tree_item_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_ITEM (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
if (GTK_WIDGET_DRAWABLE (widget))
|
|
|
|
gtk_tree_item_draw(widget, &event->area);
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_tree_item_focus_in (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_ITEM (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
|
|
|
|
gtk_widget_draw_focus (widget);
|
|
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
gtk_tree_item_focus_out (GtkWidget *widget,
|
|
|
|
GdkEventFocus *event)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_ITEM (widget), FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
|
|
|
|
gtk_widget_draw_focus (widget);
|
|
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_real_tree_item_select (GtkItem *item)
|
1998-03-11 04:05:15 +00:00
|
|
|
{
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
GtkTreeItem *tree_item;
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
g_return_if_fail (item != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (item));
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
tree_item = GTK_TREE_ITEM (item);
|
|
|
|
widget = GTK_WIDGET (item);
|
1997-12-19 05:41:45 +00:00
|
|
|
|
|
|
|
gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_SELECTED);
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
if (!widget->parent || GTK_TREE (widget->parent)->view_mode == GTK_TREE_VIEW_LINE)
|
|
|
|
gtk_widget_set_state (GTK_TREE_ITEM (item)->pixmaps_box, GTK_STATE_SELECTED);
|
1997-12-17 23:41:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_real_tree_item_deselect (GtkItem *item)
|
|
|
|
{
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
GtkTreeItem *tree_item;
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
g_return_if_fail (item != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (item));
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
tree_item = GTK_TREE_ITEM (item);
|
|
|
|
widget = GTK_WIDGET (item);
|
1997-12-17 23:41:42 +00:00
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
gtk_widget_set_state (widget, GTK_STATE_NORMAL);
|
1997-12-17 23:41:42 +00:00
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
if (!widget->parent || GTK_TREE (widget->parent)->view_mode == GTK_TREE_VIEW_LINE)
|
|
|
|
gtk_widget_set_state (tree_item->pixmaps_box, GTK_STATE_NORMAL);
|
1997-12-17 23:41:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_real_tree_item_toggle (GtkItem *item)
|
|
|
|
{
|
|
|
|
g_return_if_fail (item != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (item));
|
|
|
|
|
1998-01-27 03:57:59 +00:00
|
|
|
if(!GTK_WIDGET_IS_SENSITIVE(item))
|
|
|
|
return;
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
if (GTK_WIDGET (item)->parent && GTK_IS_TREE (GTK_WIDGET (item)->parent))
|
|
|
|
gtk_tree_select_child (GTK_TREE (GTK_WIDGET (item)->parent),
|
|
|
|
GTK_WIDGET (item));
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Should we really bother with this bit? A listitem not in a list?
|
|
|
|
* -Johannes Keukelaar
|
1998-11-06 22:05:02 +00:00
|
|
|
* yes, always be on the safe side!
|
1997-12-17 23:41:42 +00:00
|
|
|
* -timj
|
|
|
|
*/
|
|
|
|
if (GTK_WIDGET (item)->state == GTK_STATE_SELECTED)
|
|
|
|
gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_NORMAL);
|
|
|
|
else
|
|
|
|
gtk_widget_set_state (GTK_WIDGET (item), GTK_STATE_SELECTED);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_real_tree_item_expand (GtkTreeItem *tree_item)
|
|
|
|
{
|
|
|
|
GtkTree* tree;
|
|
|
|
|
|
|
|
g_return_if_fail (tree_item != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (tree_item));
|
1998-03-11 04:05:15 +00:00
|
|
|
|
|
|
|
if (tree_item->subtree && !tree_item->expanded)
|
1997-12-17 23:41:42 +00:00
|
|
|
{
|
1998-03-11 04:05:15 +00:00
|
|
|
tree = GTK_TREE (GTK_WIDGET (tree_item)->parent);
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
/* hide subtree widget */
|
1998-03-11 04:05:15 +00:00
|
|
|
gtk_widget_show (tree_item->subtree);
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
/* hide button '+' and show button '-' */
|
1998-03-11 04:05:15 +00:00
|
|
|
if (tree_item->pixmaps_box)
|
|
|
|
{
|
|
|
|
gtk_container_remove (GTK_CONTAINER (tree_item->pixmaps_box),
|
|
|
|
tree_item->plus_pix_widget);
|
|
|
|
gtk_container_add (GTK_CONTAINER (tree_item->pixmaps_box),
|
|
|
|
tree_item->minus_pix_widget);
|
|
|
|
}
|
|
|
|
if (tree->root_tree)
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (tree->root_tree));
|
1997-12-17 23:41:42 +00:00
|
|
|
tree_item->expanded = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_real_tree_item_collapse (GtkTreeItem *tree_item)
|
|
|
|
{
|
|
|
|
GtkTree* tree;
|
1998-03-11 04:05:15 +00:00
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
g_return_if_fail (tree_item != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (tree_item));
|
1998-03-11 04:05:15 +00:00
|
|
|
|
|
|
|
if (tree_item->subtree && tree_item->expanded)
|
1997-12-17 23:41:42 +00:00
|
|
|
{
|
1998-03-11 04:05:15 +00:00
|
|
|
tree = GTK_TREE (GTK_WIDGET (tree_item)->parent);
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
/* hide subtree widget */
|
1998-03-11 04:05:15 +00:00
|
|
|
gtk_widget_hide (tree_item->subtree);
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
/* hide button '-' and show button '+' */
|
1998-03-11 04:05:15 +00:00
|
|
|
if (tree_item->pixmaps_box)
|
|
|
|
{
|
|
|
|
gtk_container_remove (GTK_CONTAINER (tree_item->pixmaps_box),
|
|
|
|
tree_item->minus_pix_widget);
|
|
|
|
gtk_container_add (GTK_CONTAINER (tree_item->pixmaps_box),
|
|
|
|
tree_item->plus_pix_widget);
|
|
|
|
}
|
|
|
|
if (tree->root_tree)
|
|
|
|
gtk_widget_queue_resize (GTK_WIDGET (tree->root_tree));
|
1997-12-17 23:41:42 +00:00
|
|
|
tree_item->expanded = FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_item_destroy (GtkObject *object)
|
|
|
|
{
|
|
|
|
GtkTreeItem* item;
|
|
|
|
GtkWidget* child;
|
|
|
|
|
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (object));
|
|
|
|
|
1998-03-02 00:32:52 +00:00
|
|
|
#ifdef TREE_DEBUG
|
1998-08-18 03:59:41 +00:00
|
|
|
g_message("+ gtk_tree_item_destroy [object %#x]\n", (int)object);
|
1998-03-02 00:32:52 +00:00
|
|
|
#endif /* TREE_DEBUG */
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
item = GTK_TREE_ITEM(object);
|
|
|
|
|
|
|
|
/* free sub tree if it exist */
|
1998-03-11 04:05:15 +00:00
|
|
|
child = item->subtree;
|
|
|
|
if (child)
|
1997-12-17 23:41:42 +00:00
|
|
|
{
|
1998-01-30 23:47:09 +00:00
|
|
|
gtk_widget_ref (child);
|
|
|
|
gtk_widget_unparent (child);
|
1997-12-17 23:41:42 +00:00
|
|
|
gtk_widget_destroy (child);
|
1998-01-30 23:47:09 +00:00
|
|
|
gtk_widget_unref (child);
|
|
|
|
item->subtree = NULL;
|
1997-12-17 23:41:42 +00:00
|
|
|
}
|
1998-03-11 04:05:15 +00:00
|
|
|
|
1997-12-19 05:41:45 +00:00
|
|
|
/* free pixmaps box */
|
1998-03-11 04:05:15 +00:00
|
|
|
child = item->pixmaps_box;
|
|
|
|
if (child)
|
1997-12-19 05:41:45 +00:00
|
|
|
{
|
1998-01-30 23:47:09 +00:00
|
|
|
gtk_widget_ref (child);
|
|
|
|
gtk_widget_unparent (child);
|
1997-12-19 05:41:45 +00:00
|
|
|
gtk_widget_destroy (child);
|
1998-01-30 23:47:09 +00:00
|
|
|
gtk_widget_unref (child);
|
|
|
|
item->pixmaps_box = NULL;
|
|
|
|
}
|
1998-03-11 04:05:15 +00:00
|
|
|
|
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
/* destroy plus pixmap */
|
|
|
|
if (item->plus_pix_widget)
|
|
|
|
{
|
|
|
|
gtk_widget_destroy (item->plus_pix_widget);
|
|
|
|
gtk_widget_unref (item->plus_pix_widget);
|
|
|
|
item->plus_pix_widget = NULL;
|
1997-12-19 05:41:45 +00:00
|
|
|
}
|
1998-03-11 04:05:15 +00:00
|
|
|
|
1998-01-30 23:47:09 +00:00
|
|
|
/* destroy minus pixmap */
|
|
|
|
if (item->minus_pix_widget)
|
|
|
|
{
|
|
|
|
gtk_widget_destroy (item->minus_pix_widget);
|
|
|
|
gtk_widget_unref (item->minus_pix_widget);
|
|
|
|
item->minus_pix_widget = NULL;
|
|
|
|
}
|
1998-03-11 04:05:15 +00:00
|
|
|
|
1998-03-05 06:32:42 +00:00
|
|
|
/* By removing the pixmaps here, and not in unrealize, we depend on
|
|
|
|
* the fact that a widget can never change colormap or visual.
|
|
|
|
*/
|
|
|
|
gtk_tree_item_remove_pixmaps (item);
|
1998-01-30 23:47:09 +00:00
|
|
|
|
1998-03-11 04:05:15 +00:00
|
|
|
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
|
|
|
|
1998-03-02 00:32:52 +00:00
|
|
|
#ifdef TREE_DEBUG
|
1998-08-18 03:59:41 +00:00
|
|
|
g_message("- gtk_tree_item_destroy\n");
|
1998-03-02 00:32:52 +00:00
|
|
|
#endif /* TREE_DEBUG */
|
1997-12-17 23:41:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_tree_item_remove_subtree (GtkTreeItem* item)
|
|
|
|
{
|
1998-03-11 04:05:15 +00:00
|
|
|
g_return_if_fail (item != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM(item));
|
|
|
|
g_return_if_fail (item->subtree != NULL);
|
|
|
|
|
|
|
|
if (GTK_TREE (item->subtree)->children)
|
1998-05-01 04:23:59 +00:00
|
|
|
{
|
|
|
|
/* The following call will remove the children and call
|
|
|
|
* gtk_tree_item_remove_subtree() again. So we are done.
|
|
|
|
*/
|
|
|
|
gtk_tree_remove_items (GTK_TREE (item->subtree),
|
|
|
|
GTK_TREE (item->subtree)->children);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
if (GTK_WIDGET_MAPPED (item->subtree))
|
|
|
|
gtk_widget_unmap (item->subtree);
|
1998-05-01 04:23:59 +00:00
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
gtk_widget_unparent (item->subtree);
|
1998-03-11 04:05:15 +00:00
|
|
|
|
|
|
|
if (item->pixmaps_box)
|
|
|
|
gtk_widget_hide (item->pixmaps_box);
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
item->subtree = NULL;
|
1998-05-01 04:23:59 +00:00
|
|
|
|
|
|
|
if (item->expanded)
|
1998-03-11 04:05:15 +00:00
|
|
|
{
|
1998-05-01 04:23:59 +00:00
|
|
|
item->expanded = FALSE;
|
|
|
|
if (item->pixmaps_box)
|
|
|
|
{
|
|
|
|
gtk_container_remove (GTK_CONTAINER (item->pixmaps_box),
|
|
|
|
item->minus_pix_widget);
|
|
|
|
gtk_container_add (GTK_CONTAINER (item->pixmaps_box),
|
|
|
|
item->plus_pix_widget);
|
|
|
|
}
|
1998-03-11 04:05:15 +00:00
|
|
|
}
|
1997-12-17 23:41:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_item_map (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkBin *bin;
|
|
|
|
GtkTreeItem* item;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (widget));
|
|
|
|
|
|
|
|
bin = GTK_BIN (widget);
|
|
|
|
item = GTK_TREE_ITEM(widget);
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
|
|
|
|
|
1997-12-17 23:41:42 +00:00
|
|
|
if(item->pixmaps_box &&
|
|
|
|
GTK_WIDGET_VISIBLE (item->pixmaps_box) &&
|
|
|
|
!GTK_WIDGET_MAPPED (item->pixmaps_box))
|
|
|
|
gtk_widget_map (item->pixmaps_box);
|
|
|
|
|
|
|
|
if (bin->child &&
|
|
|
|
GTK_WIDGET_VISIBLE (bin->child) &&
|
|
|
|
!GTK_WIDGET_MAPPED (bin->child))
|
|
|
|
gtk_widget_map (bin->child);
|
1999-01-15 16:00:39 +00:00
|
|
|
|
|
|
|
gdk_window_show (widget->window);
|
1997-12-17 23:41:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_item_unmap (GtkWidget *widget)
|
|
|
|
{
|
|
|
|
GtkBin *bin;
|
|
|
|
GtkTreeItem* item;
|
|
|
|
|
|
|
|
g_return_if_fail (widget != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (widget));
|
|
|
|
|
|
|
|
GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);
|
|
|
|
bin = GTK_BIN (widget);
|
|
|
|
item = GTK_TREE_ITEM(widget);
|
|
|
|
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
gdk_window_hide (widget->window);
|
1997-12-17 23:41:42 +00:00
|
|
|
|
|
|
|
if(item->pixmaps_box &&
|
|
|
|
GTK_WIDGET_VISIBLE (item->pixmaps_box) &&
|
|
|
|
GTK_WIDGET_MAPPED (item->pixmaps_box))
|
|
|
|
gtk_widget_unmap (bin->child);
|
|
|
|
|
|
|
|
if (bin->child &&
|
|
|
|
GTK_WIDGET_VISIBLE (bin->child) &&
|
|
|
|
GTK_WIDGET_MAPPED (bin->child))
|
|
|
|
gtk_widget_unmap (bin->child);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
GTK_MENU_DIR_CHILD: check for the existance of
Thu Sep 3 04:22:20 1998 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_real_menu_shell_move_current):
GTK_MENU_DIR_CHILD: check for the existance of
menu_shell->active_menu_item before accessing its child.
GTK_MENU_DIR_PREV:
GTK_MENU_DIR_NEXT: if we haven't had an active item and still
don't, make a default selection.
Wed Sep 2 00:28:58 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_propagate_state): iterate
the children with _forall for sensitivity changes and with
_foreach on pure state changes. this fixes a lot of the
old inclusions of internal widgets into _foreach calls.
* gtk/gtktree.c: removed gtk_tree_foreach, let gtk_tree_forall
do the work. don't walk the subtrees of first level children.
* gtk/gtktreeitem.c: provide a _forall implementation,
which walks the subtrees as well for include_internals.
* gtk/gtkmenuitem.c: provide a _forall implementation, which walks
the submenus as well for include_internals.
* gtk/gtkscrolledwindow.c: removed gtk_scrolled_window_foreach and
implemented gtk_scrolled_window_forall, which will iterate over
the viewport and the scrollbars for gtk_container_forall or
iterate over the viewports children for gtk_container_foreach.
* gtk/gtktoolbar.c:
* gtk/gtktable.c:
* gtk/gtkpaned.c:
* gtk/gtkpacker.c:
* gtk/gtkmenushell.c:
* gtk/gtklist.c:
* gtk/gtkfixed.c:
* gtk/gtkclist.c:
* gtk/gtkbox.c:
* gtk/gtkbin.c:
* gtk/gtknotebook.c:
removed the old gtk_*_foreach functions and provided gtk_*_forall.
* gtk/gtknotebook.c:
(gtk_notebook_real_switch_page): expose tabs.
(gtk_notebook_page_num): new function to return the page number
of a distinct child.
(gtk_notebook_focus): minor fixups. foxus handling is still screwed
under some circumstances.
* gtk/gtktreeitem.c:
(gtk_real_tree_item_select):
(gtk_real_tree_item_deselect): major fixes.
some general fixups wrt queue_redraw, and tree items not being
NO_WINDOW widgets.
* gtk/gtklistitem.c:
(gtk_real_list_item_select):
(gtk_real_list_item_deselect):
(gtk_real_list_item_toggle):
removed unneccessary queue_redraw calls.
Wed Aug 30 09:42:07 1998 Tim Janik <timj@gtk.org>
* gtk/gtkoptionmenu.c: allow optionmenus to have the focus and
automatically popup the menu on space bar.
Wed Aug 26 06:40:34 1998 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.h:
* gtk/gtkcontainer.c: implemented gtk_container_forall() (as a class
method), which acts similar to gtk_container_foreach(), but iterates
over internal children. the GtkContainer::foreach signal vanished in
favour of a new class method ->forall() that optionally includes
internal widgets.
* gtk/gtkclist.c (gtk_clist_init): provide no _foreach implementation
but a _forall implementation, since all child widgets we have are
internal ones.
(column_button_create): set the parent window prior
to gtk_widget_set_parent().
* gtk/gtkwidget.c:
exchanged all calls to gtk_container_foreach() with
gtk_container_forall().
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: added the GTK_COMPOSITE_CHILD, exported through
the GtkWidget::composite_child argument. to have a widget created
with the flag initially, two new functions got added to wrap a widgets
creation:
gtk_widget_push_composite_flag() and gtk_widget_pop_composite_flag().
Wed Aug 25 23:37:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktooltips.h:
* gtk/gtktooltips.c: exported gtk_tooltips_create_window() as
gtk_tooltips_force_window(), so tooltips->tip_window can be accessed
prior to the first tip being set.
don't put an extra reference on the window, since it is a toplevel,
it wont get destroyed from anywhere else.
* overall macro and GtkType fixups.
1998-09-03 02:38:53 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_item_forall (GtkContainer *container,
|
|
|
|
gboolean include_internals,
|
|
|
|
GtkCallback callback,
|
|
|
|
gpointer callback_data)
|
|
|
|
{
|
|
|
|
GtkBin *bin;
|
|
|
|
GtkTreeItem *tree_item;
|
|
|
|
|
|
|
|
g_return_if_fail (container != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_TREE_ITEM (container));
|
|
|
|
g_return_if_fail (callback != NULL);
|
|
|
|
|
|
|
|
bin = GTK_BIN (container);
|
|
|
|
tree_item = GTK_TREE_ITEM (container);
|
|
|
|
|
|
|
|
if (bin->child)
|
|
|
|
(* callback) (bin->child, callback_data);
|
|
|
|
if (include_internals && tree_item->subtree)
|
|
|
|
(* callback) (tree_item->subtree, callback_data);
|
|
|
|
}
|