From 800afc55d7031b1c088337df61c4c74e16ddb563 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Sat, 21 Feb 1998 14:11:40 +0000 Subject: [PATCH] gtk_object_query_args takes an additional pointer now which if supplied Sat Feb 21 14:49:17 1998 Tim Janik * gtk/gtkobject.h: * gtk/gtkobject.c: gtk_object_query_args takes an additional pointer now which if supplied will point to an array holding the sequential argument ids. * gtk/gtktree.c: fix emission of selection_changed signal, supplied by Bolliet Jerome. * gtk/gtktreeitem.c: inline the plus and minus pixmaps, supplied by Bolliet Jerome. * gtk/gtknotebook.c: do a resize when a page is removed and don't refer to the removed page on the switch signal, supplied by Lars Hamann and Stefan Jeske. * gtk/gtktoolbar.h: * gtk/gtktoolbar.c: gtk_toolbar_append_item, gtk_toolbar_prepend_item, gtk_toolbar_insert_item, gtk_toolbar_append_widget, gtk_toolbar_prepend_widget, gtk_toolbar_insert_widget: take an additional gchar *tooltip_private_text as argument to fully support the underlying call to gtk_tooltip_set_tip. (made the ChangeLog catch up with my last commits). --- ChangeLog | 25 ++++++++++++++++ ChangeLog.pre-2-0 | 25 ++++++++++++++++ ChangeLog.pre-2-10 | 25 ++++++++++++++++ ChangeLog.pre-2-2 | 25 ++++++++++++++++ ChangeLog.pre-2-4 | 25 ++++++++++++++++ ChangeLog.pre-2-6 | 25 ++++++++++++++++ ChangeLog.pre-2-8 | 25 ++++++++++++++++ gtk/gtknotebook.c | 12 ++++++-- gtk/gtktree.c | 4 +-- gtk/gtktreeitem.c | 73 ++++++++++++---------------------------------- gtk/testtree.c | 2 ++ 11 files changed, 208 insertions(+), 58 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb9ce76606..fb9512c72f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +Sat Feb 21 14:49:17 1998 Tim Janik + + * gtk/gtkobject.h: + * gtk/gtkobject.c: gtk_object_query_args takes an additional pointer + now which if supplied will point to an array holding the sequential + argument ids. + + * gtk/gtktree.c: fix emission of selection_changed signal, supplied + by Bolliet Jerome. + + * gtk/gtktreeitem.c: inline the plus and minus pixmaps, supplied by + Bolliet Jerome. + + * gtk/gtknotebook.c: do a resize when a page is removed and don't + refer to the removed page on the switch signal, supplied by Lars Hamann + and Stefan Jeske. + + * gtk/gtktoolbar.h: + * gtk/gtktoolbar.c: + gtk_toolbar_append_item, gtk_toolbar_prepend_item, + gtk_toolbar_insert_item, gtk_toolbar_append_widget, + gtk_toolbar_prepend_widget, gtk_toolbar_insert_widget: take an additional + gchar *tooltip_private_text as argument to fully support the underlying + call to gtk_tooltip_set_tip. + Fri Feb 20 16:44:57 GMT 1998 Tony Gale * docs/gtkfaq.sgml: added to list of GTK apps, added permissions notice diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index fb9ce76606..fb9512c72f 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,28 @@ +Sat Feb 21 14:49:17 1998 Tim Janik + + * gtk/gtkobject.h: + * gtk/gtkobject.c: gtk_object_query_args takes an additional pointer + now which if supplied will point to an array holding the sequential + argument ids. + + * gtk/gtktree.c: fix emission of selection_changed signal, supplied + by Bolliet Jerome. + + * gtk/gtktreeitem.c: inline the plus and minus pixmaps, supplied by + Bolliet Jerome. + + * gtk/gtknotebook.c: do a resize when a page is removed and don't + refer to the removed page on the switch signal, supplied by Lars Hamann + and Stefan Jeske. + + * gtk/gtktoolbar.h: + * gtk/gtktoolbar.c: + gtk_toolbar_append_item, gtk_toolbar_prepend_item, + gtk_toolbar_insert_item, gtk_toolbar_append_widget, + gtk_toolbar_prepend_widget, gtk_toolbar_insert_widget: take an additional + gchar *tooltip_private_text as argument to fully support the underlying + call to gtk_tooltip_set_tip. + Fri Feb 20 16:44:57 GMT 1998 Tony Gale * docs/gtkfaq.sgml: added to list of GTK apps, added permissions notice diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index fb9ce76606..fb9512c72f 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,28 @@ +Sat Feb 21 14:49:17 1998 Tim Janik + + * gtk/gtkobject.h: + * gtk/gtkobject.c: gtk_object_query_args takes an additional pointer + now which if supplied will point to an array holding the sequential + argument ids. + + * gtk/gtktree.c: fix emission of selection_changed signal, supplied + by Bolliet Jerome. + + * gtk/gtktreeitem.c: inline the plus and minus pixmaps, supplied by + Bolliet Jerome. + + * gtk/gtknotebook.c: do a resize when a page is removed and don't + refer to the removed page on the switch signal, supplied by Lars Hamann + and Stefan Jeske. + + * gtk/gtktoolbar.h: + * gtk/gtktoolbar.c: + gtk_toolbar_append_item, gtk_toolbar_prepend_item, + gtk_toolbar_insert_item, gtk_toolbar_append_widget, + gtk_toolbar_prepend_widget, gtk_toolbar_insert_widget: take an additional + gchar *tooltip_private_text as argument to fully support the underlying + call to gtk_tooltip_set_tip. + Fri Feb 20 16:44:57 GMT 1998 Tony Gale * docs/gtkfaq.sgml: added to list of GTK apps, added permissions notice diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index fb9ce76606..fb9512c72f 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,28 @@ +Sat Feb 21 14:49:17 1998 Tim Janik + + * gtk/gtkobject.h: + * gtk/gtkobject.c: gtk_object_query_args takes an additional pointer + now which if supplied will point to an array holding the sequential + argument ids. + + * gtk/gtktree.c: fix emission of selection_changed signal, supplied + by Bolliet Jerome. + + * gtk/gtktreeitem.c: inline the plus and minus pixmaps, supplied by + Bolliet Jerome. + + * gtk/gtknotebook.c: do a resize when a page is removed and don't + refer to the removed page on the switch signal, supplied by Lars Hamann + and Stefan Jeske. + + * gtk/gtktoolbar.h: + * gtk/gtktoolbar.c: + gtk_toolbar_append_item, gtk_toolbar_prepend_item, + gtk_toolbar_insert_item, gtk_toolbar_append_widget, + gtk_toolbar_prepend_widget, gtk_toolbar_insert_widget: take an additional + gchar *tooltip_private_text as argument to fully support the underlying + call to gtk_tooltip_set_tip. + Fri Feb 20 16:44:57 GMT 1998 Tony Gale * docs/gtkfaq.sgml: added to list of GTK apps, added permissions notice diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index fb9ce76606..fb9512c72f 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,28 @@ +Sat Feb 21 14:49:17 1998 Tim Janik + + * gtk/gtkobject.h: + * gtk/gtkobject.c: gtk_object_query_args takes an additional pointer + now which if supplied will point to an array holding the sequential + argument ids. + + * gtk/gtktree.c: fix emission of selection_changed signal, supplied + by Bolliet Jerome. + + * gtk/gtktreeitem.c: inline the plus and minus pixmaps, supplied by + Bolliet Jerome. + + * gtk/gtknotebook.c: do a resize when a page is removed and don't + refer to the removed page on the switch signal, supplied by Lars Hamann + and Stefan Jeske. + + * gtk/gtktoolbar.h: + * gtk/gtktoolbar.c: + gtk_toolbar_append_item, gtk_toolbar_prepend_item, + gtk_toolbar_insert_item, gtk_toolbar_append_widget, + gtk_toolbar_prepend_widget, gtk_toolbar_insert_widget: take an additional + gchar *tooltip_private_text as argument to fully support the underlying + call to gtk_tooltip_set_tip. + Fri Feb 20 16:44:57 GMT 1998 Tony Gale * docs/gtkfaq.sgml: added to list of GTK apps, added permissions notice diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index fb9ce76606..fb9512c72f 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,28 @@ +Sat Feb 21 14:49:17 1998 Tim Janik + + * gtk/gtkobject.h: + * gtk/gtkobject.c: gtk_object_query_args takes an additional pointer + now which if supplied will point to an array holding the sequential + argument ids. + + * gtk/gtktree.c: fix emission of selection_changed signal, supplied + by Bolliet Jerome. + + * gtk/gtktreeitem.c: inline the plus and minus pixmaps, supplied by + Bolliet Jerome. + + * gtk/gtknotebook.c: do a resize when a page is removed and don't + refer to the removed page on the switch signal, supplied by Lars Hamann + and Stefan Jeske. + + * gtk/gtktoolbar.h: + * gtk/gtktoolbar.c: + gtk_toolbar_append_item, gtk_toolbar_prepend_item, + gtk_toolbar_insert_item, gtk_toolbar_append_widget, + gtk_toolbar_prepend_widget, gtk_toolbar_insert_widget: take an additional + gchar *tooltip_private_text as argument to fully support the underlying + call to gtk_tooltip_set_tip. + Fri Feb 20 16:44:57 GMT 1998 Tony Gale * docs/gtkfaq.sgml: added to list of GTK apps, added permissions notice diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index fb9ce76606..fb9512c72f 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,28 @@ +Sat Feb 21 14:49:17 1998 Tim Janik + + * gtk/gtkobject.h: + * gtk/gtkobject.c: gtk_object_query_args takes an additional pointer + now which if supplied will point to an array holding the sequential + argument ids. + + * gtk/gtktree.c: fix emission of selection_changed signal, supplied + by Bolliet Jerome. + + * gtk/gtktreeitem.c: inline the plus and minus pixmaps, supplied by + Bolliet Jerome. + + * gtk/gtknotebook.c: do a resize when a page is removed and don't + refer to the removed page on the switch signal, supplied by Lars Hamann + and Stefan Jeske. + + * gtk/gtktoolbar.h: + * gtk/gtktoolbar.c: + gtk_toolbar_append_item, gtk_toolbar_prepend_item, + gtk_toolbar_insert_item, gtk_toolbar_append_widget, + gtk_toolbar_prepend_widget, gtk_toolbar_insert_widget: take an additional + gchar *tooltip_private_text as argument to fully support the underlying + call to gtk_tooltip_set_tip. + Fri Feb 20 16:44:57 GMT 1998 Tony Gale * docs/gtkfaq.sgml: added to list of GTK apps, added permissions notice diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index a638472e1d..90c7e367d7 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -478,6 +478,7 @@ gtk_notebook_real_remove (GtkNotebook *notebook, { GtkNotebookPage *page; GList * next_list; + gint need_resize = FALSE; if (list->prev) { @@ -494,13 +495,12 @@ gtk_notebook_real_remove (GtkNotebook *notebook, if (notebook->cur_page == list->data) { + notebook->cur_page = NULL; if (next_list) { page = next_list->data; gtk_notebook_switch_page (notebook, page, page_num); } - else - notebook->cur_page = NULL; } if (list == notebook->first_tab) @@ -510,6 +510,10 @@ gtk_notebook_real_remove (GtkNotebook *notebook, page = list->data; + if ((GTK_WIDGET_VISIBLE (page->child) || + GTK_WIDGET_VISIBLE (page->tab_label)) && GTK_WIDGET_VISIBLE (notebook)) + need_resize = TRUE; + gtk_widget_unparent (page->child); gtk_widget_unparent (page->tab_label); @@ -527,6 +531,10 @@ gtk_notebook_real_remove (GtkNotebook *notebook, notebook->children = g_list_remove_link (notebook->children, list); g_list_free (list); g_free (page); + + if (need_resize) + gtk_widget_queue_resize (GTK_WIDGET (notebook)); + } gint diff --git a/gtk/gtktree.c b/gtk/gtktree.c index 8bc7145589..cf45e6cf67 100644 --- a/gtk/gtktree.c +++ b/gtk/gtktree.c @@ -271,12 +271,10 @@ gtk_tree_add (GtkContainer *container, tree->children = g_list_append (tree->children, widget); -#if 0 if (!tree->selection && (tree->selection_mode == GTK_SELECTION_BROWSE)) { gtk_tree_select_child (tree, widget); } -#endif if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (container)) gtk_widget_queue_resize (widget); @@ -946,6 +944,8 @@ gtk_real_tree_select_child (GtkTree *tree, gtk_signal_emit (GTK_OBJECT (tree->root_tree), tree_signals[SELECTION_CHANGED]); + break; + case GTK_SELECTION_BROWSE: selection = root_selection; diff --git a/gtk/gtktreeitem.c b/gtk/gtktreeitem.c index 385551c6c6..04bdeb5d74 100644 --- a/gtk/gtktreeitem.c +++ b/gtk/gtktreeitem.c @@ -23,18 +23,11 @@ #include "gtkmain.h" #include "gtksignal.h" -/* remove comment if you want replace loading pixmap by static bitmap - for icons - experimental code and it is buggy */ -/* #define WITH_BITMAP */ +#include "tree_plus.xpm" +#include "tree_minus.xpm" #define DEFAULT_DELTA 9 -#ifdef WITH_BITMAP -#include "tree_plus.xbm" -#include "tree_minus.xbm" -#endif - enum { COLLAPSE_TREE, EXPAND_TREE, @@ -199,47 +192,27 @@ gtk_tree_item_init (GtkTreeItem *tree_item) GtkWidget *eventbox, *pixmapwid; static GdkPixmap *pixmap_plus = NULL; static GdkPixmap *pixmap_minus = NULL; -#ifndef WITH_BITMAP - static GdkBitmap *mask = NULL; -#endif - static GtkStyle *style = NULL; + static GdkBitmap *mask_plus = NULL; + static GdkBitmap *mask_minus = NULL; + GdkColor xpmcolor; tree_item->expanded = FALSE; tree_item->subtree = NULL; GTK_WIDGET_SET_FLAGS (tree_item, GTK_CAN_FOCUS); - if(style == NULL) + /* check if icons are already created */ + if(pixmap_plus == NULL && pixmap_minus == NULL) { - - style=gtk_widget_get_style(GTK_WIDGET(tree_item)); - -#ifndef WITH_BITMAP - /* create pixmaps for one time, based on xpm file */ - pixmap_plus = gdk_pixmap_create_from_xpm (GTK_WIDGET(tree_item)->window, &mask, - &style->bg[GTK_STATE_NORMAL], - "tree_plus.xpm"); - if(!pixmap_plus) - g_warning("gtk_tree_item_init: can't find tree_plus.xpm file !\n"); - - pixmap_minus = gdk_pixmap_create_from_xpm (GTK_WIDGET(tree_item)->window, &mask, - &style->bg[GTK_STATE_NORMAL], - "tree_minus.xpm"); - if(!pixmap_minus) - g_warning("gtk_tree_item_init: can't find tree_minus.xpm file !\n"); -#else - - pixmap_plus = gdk_pixmap_create_from_data(GTK_WIDGET(tree_item)->window, - (gchar*) tree_plus_bits, - tree_plus_width, tree_plus_height, -1, - &style->black, - &style->white); - - pixmap_minus = gdk_pixmap_create_from_data(GTK_WIDGET(tree_item)->window, - (gchar*) tree_minus_bits, - tree_minus_width, tree_minus_height, -1, - &style->black, - &style->white); -#endif /* WITH_BITMAP */ + /* create pixmaps for plus icon */ + pixmap_plus = gdk_pixmap_create_from_xpm_d(GTK_WIDGET(tree_item)->window, + &mask_plus, + &xpmcolor, + tree_plus); + /* create pixmaps for minus icon */ + pixmap_minus = gdk_pixmap_create_from_xpm_d(GTK_WIDGET(tree_item)->window, + &mask_minus, + &xpmcolor, + tree_minus); } if(pixmap_plus && pixmap_minus) @@ -260,11 +233,7 @@ gtk_tree_item_init (GtkTreeItem *tree_item) tree_item->pixmaps_box = eventbox; /* create pixmap for button '+' */ -#ifndef WITH_BITMAP - pixmapwid = gtk_pixmap_new (pixmap_plus, mask); -#else - pixmapwid = gtk_pixmap_new (pixmap_plus, NULL); -#endif + pixmapwid = gtk_pixmap_new (pixmap_plus, mask_plus); if(!tree_item->expanded) gtk_container_add(GTK_CONTAINER(eventbox), pixmapwid); gtk_widget_show(pixmapwid); @@ -273,11 +242,7 @@ gtk_tree_item_init (GtkTreeItem *tree_item) gtk_object_sink (GTK_OBJECT (tree_item->plus_pix_widget)); /* create pixmap for button '-' */ -#ifndef WITH_BITMAP - pixmapwid = gtk_pixmap_new (pixmap_minus, mask); -#else - pixmapwid = gtk_pixmap_new (pixmap_minus, NULL); -#endif + pixmapwid = gtk_pixmap_new (pixmap_minus, mask_minus); if(tree_item->expanded) gtk_container_add(GTK_CONTAINER(eventbox), pixmapwid); gtk_widget_show(pixmapwid); diff --git a/gtk/testtree.c b/gtk/testtree.c index 76d8341a15..20d4e3e917 100644 --- a/gtk/testtree.c +++ b/gtk/testtree.c @@ -15,6 +15,8 @@ static void cb_tree_changed(GtkTree* tree) { GList* selected; gint nb_selected; + g_print("selection changed !\n"); + tree_buttons = gtk_object_get_user_data(GTK_OBJECT(tree)); selected = tree->selection;