Fixed child->icon and child->label == NULL bugs.

1998-01-13  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* gtk/gtktoolbar.c: (gtk_real_toolbar_style_changed): Fixed
	child->icon and child->label == NULL bugs.

	* gtk/gtktoolbar.h: Added some new functions:
		gtk_toolbar_append_widget()
		gtk_toolbar_prepend_widget()
		gtk_toolbar_insert_widget()
	These let the user insert any kind of widget in the toolbar.  Also
	changed the gtk_toolbar_*_item() functions to return a
	GtkWidget * so that the user can do things with the toolbar buttons.

	* gtk/gtktoolbar.c: Now the toolbar supports its own buttons and
	arbitrary widgets as well.  Geometry management has been changed
	accordingly.  Added gtk_toolbar_remove() function, so container
	functionality should be complete now.

	* gtk/testgtk.c (create_toolbar): Added an entry widget to test
	the new toolbar.

	* Most of these changes are adapted from the
	gtk-lupus-970112-0-patch (should be 970112... :-)
This commit is contained in:
Federico Mena Quintero
1998-01-13 06:14:52 +00:00
committed by Arturo Espinosa
parent 284882b8c7
commit 139026de73
11 changed files with 539 additions and 118 deletions

View File

@ -632,12 +632,13 @@ create_toolbar (void)
{
static GtkWidget *window = NULL;
GtkWidget *toolbar;
GtkWidget *entry;
if (!window)
{
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Toolbar test");
gtk_window_set_policy (GTK_WINDOW (window), TRUE, TRUE, TRUE);
gtk_window_set_policy (GTK_WINDOW (window), FALSE, TRUE, TRUE);
gtk_signal_connect (GTK_OBJECT (window), "destroy",
GTK_SIGNAL_FUNC (destroy_window),
@ -682,6 +683,12 @@ create_toolbar (void)
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
entry = gtk_entry_new ();
gtk_widget_show(entry);
gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar), NULL, entry);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Small", "Use small spaces",
GTK_PIXMAP (new_pixmap ("test.xpm", window->window,