Commit 6e7f4a99 authored by Federico Mena Quintero's avatar Federico Mena Quintero Committed by Arturo Espinosa

Moved the gtk_signal_connect of the specified callback into the big

1998-03-14  Federico Mena Quintero  <federico@nuclecu.unam.mx>

	* gtk/gtktoolbar.c (gtk_toolbar_insert_element): Moved the
	gtk_signal_connect of the specified callback into the big switch()
	for buttons.  We don't want to connect to the "clicked" signal of
	a custom widget or a space element, because it may not have one.
	(gtk_toolbar_insert_element): Extra sanity check; if the type is
	GTK_TOOLBAR_CHILD_WIDGET, then the specified widget must not be NULL.
parent cfd3a513
1998-03-14 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtktoolbar.c (gtk_toolbar_insert_element): Moved the
gtk_signal_connect of the specified callback into the big switch()
for buttons. We don't want to connect to the "clicked" signal of
a custom widget or a space element, because it may not have one.
(gtk_toolbar_insert_element): Extra sanity check; if the type is
GTK_TOOLBAR_CHILD_WIDGET, then the specified widget must not be NULL.
Sat Mar 14 02:54:28 PST 1998 Manish Singh <yosh@gimp.org> Sat Mar 14 02:54:28 PST 1998 Manish Singh <yosh@gimp.org>
* gtk.m4: fixed a bashism in gtk tests * gtk.m4: fixed a bashism in gtk tests
......
1998-03-14 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtktoolbar.c (gtk_toolbar_insert_element): Moved the
gtk_signal_connect of the specified callback into the big switch()
for buttons. We don't want to connect to the "clicked" signal of
a custom widget or a space element, because it may not have one.
(gtk_toolbar_insert_element): Extra sanity check; if the type is
GTK_TOOLBAR_CHILD_WIDGET, then the specified widget must not be NULL.
Sat Mar 14 02:54:28 PST 1998 Manish Singh <yosh@gimp.org> Sat Mar 14 02:54:28 PST 1998 Manish Singh <yosh@gimp.org>
* gtk.m4: fixed a bashism in gtk tests * gtk.m4: fixed a bashism in gtk tests
......
1998-03-14 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtktoolbar.c (gtk_toolbar_insert_element): Moved the
gtk_signal_connect of the specified callback into the big switch()
for buttons. We don't want to connect to the "clicked" signal of
a custom widget or a space element, because it may not have one.
(gtk_toolbar_insert_element): Extra sanity check; if the type is
GTK_TOOLBAR_CHILD_WIDGET, then the specified widget must not be NULL.
Sat Mar 14 02:54:28 PST 1998 Manish Singh <yosh@gimp.org> Sat Mar 14 02:54:28 PST 1998 Manish Singh <yosh@gimp.org>
* gtk.m4: fixed a bashism in gtk tests * gtk.m4: fixed a bashism in gtk tests
......
1998-03-14 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtktoolbar.c (gtk_toolbar_insert_element): Moved the
gtk_signal_connect of the specified callback into the big switch()
for buttons. We don't want to connect to the "clicked" signal of
a custom widget or a space element, because it may not have one.
(gtk_toolbar_insert_element): Extra sanity check; if the type is
GTK_TOOLBAR_CHILD_WIDGET, then the specified widget must not be NULL.
Sat Mar 14 02:54:28 PST 1998 Manish Singh <yosh@gimp.org> Sat Mar 14 02:54:28 PST 1998 Manish Singh <yosh@gimp.org>
* gtk.m4: fixed a bashism in gtk tests * gtk.m4: fixed a bashism in gtk tests
......
1998-03-14 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtktoolbar.c (gtk_toolbar_insert_element): Moved the
gtk_signal_connect of the specified callback into the big switch()
for buttons. We don't want to connect to the "clicked" signal of
a custom widget or a space element, because it may not have one.
(gtk_toolbar_insert_element): Extra sanity check; if the type is
GTK_TOOLBAR_CHILD_WIDGET, then the specified widget must not be NULL.
Sat Mar 14 02:54:28 PST 1998 Manish Singh <yosh@gimp.org> Sat Mar 14 02:54:28 PST 1998 Manish Singh <yosh@gimp.org>
* gtk.m4: fixed a bashism in gtk tests * gtk.m4: fixed a bashism in gtk tests
......
1998-03-14 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtktoolbar.c (gtk_toolbar_insert_element): Moved the
gtk_signal_connect of the specified callback into the big switch()
for buttons. We don't want to connect to the "clicked" signal of
a custom widget or a space element, because it may not have one.
(gtk_toolbar_insert_element): Extra sanity check; if the type is
GTK_TOOLBAR_CHILD_WIDGET, then the specified widget must not be NULL.
Sat Mar 14 02:54:28 PST 1998 Manish Singh <yosh@gimp.org> Sat Mar 14 02:54:28 PST 1998 Manish Singh <yosh@gimp.org>
* gtk.m4: fixed a bashism in gtk tests * gtk.m4: fixed a bashism in gtk tests
......
1998-03-14 Federico Mena Quintero <federico@nuclecu.unam.mx>
* gtk/gtktoolbar.c (gtk_toolbar_insert_element): Moved the
gtk_signal_connect of the specified callback into the big switch()
for buttons. We don't want to connect to the "clicked" signal of
a custom widget or a space element, because it may not have one.
(gtk_toolbar_insert_element): Extra sanity check; if the type is
GTK_TOOLBAR_CHILD_WIDGET, then the specified widget must not be NULL.
Sat Mar 14 02:54:28 PST 1998 Manish Singh <yosh@gimp.org> Sat Mar 14 02:54:28 PST 1998 Manish Singh <yosh@gimp.org>
* gtk.m4: fixed a bashism in gtk tests * gtk.m4: fixed a bashism in gtk tests
......
...@@ -183,7 +183,7 @@ static void ...@@ -183,7 +183,7 @@ static void
gtk_toolbar_destroy (GtkObject *object) gtk_toolbar_destroy (GtkObject *object)
{ {
GtkToolbar *toolbar; GtkToolbar *toolbar;
GList *children; GList *children;
g_return_if_fail (object != NULL); g_return_if_fail (object != NULL);
g_return_if_fail (GTK_IS_TOOLBAR (object)); g_return_if_fail (GTK_IS_TOOLBAR (object));
...@@ -195,7 +195,7 @@ gtk_toolbar_destroy (GtkObject *object) ...@@ -195,7 +195,7 @@ gtk_toolbar_destroy (GtkObject *object)
for (children = toolbar->children; children; children = children->next) for (children = toolbar->children; children; children = children->next)
{ {
GtkToolbarChild *child; GtkToolbarChild *child;
child = children->data; child = children->data;
...@@ -221,8 +221,8 @@ static void ...@@ -221,8 +221,8 @@ static void
gtk_toolbar_map (GtkWidget *widget) gtk_toolbar_map (GtkWidget *widget)
{ {
GtkToolbar *toolbar; GtkToolbar *toolbar;
GList *children; GList *children;
GtkToolbarChild *child; GtkToolbarChild *child;
g_return_if_fail (widget != NULL); g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TOOLBAR (widget)); g_return_if_fail (GTK_IS_TOOLBAR (widget));
...@@ -244,8 +244,8 @@ static void ...@@ -244,8 +244,8 @@ static void
gtk_toolbar_unmap (GtkWidget *widget) gtk_toolbar_unmap (GtkWidget *widget)
{ {
GtkToolbar *toolbar; GtkToolbar *toolbar;
GList *children; GList *children;
GtkToolbarChild *child; GtkToolbarChild *child;
g_return_if_fail (widget != NULL); g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TOOLBAR (widget)); g_return_if_fail (GTK_IS_TOOLBAR (widget));
...@@ -267,10 +267,10 @@ static void ...@@ -267,10 +267,10 @@ static void
gtk_toolbar_draw (GtkWidget *widget, gtk_toolbar_draw (GtkWidget *widget,
GdkRectangle *area) GdkRectangle *area)
{ {
GtkToolbar *toolbar; GtkToolbar *toolbar;
GList *children; GList *children;
GtkToolbarChild *child; GtkToolbarChild *child;
GdkRectangle child_area; GdkRectangle child_area;
g_return_if_fail (widget != NULL); g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TOOLBAR (widget)); g_return_if_fail (GTK_IS_TOOLBAR (widget));
...@@ -294,10 +294,10 @@ static gint ...@@ -294,10 +294,10 @@ static gint
gtk_toolbar_expose (GtkWidget *widget, gtk_toolbar_expose (GtkWidget *widget,
GdkEventExpose *event) GdkEventExpose *event)
{ {
GtkToolbar *toolbar; GtkToolbar *toolbar;
GList *children; GList *children;
GtkToolbarChild *child; GtkToolbarChild *child;
GdkEventExpose child_event; GdkEventExpose child_event;
g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_TOOLBAR (widget), FALSE); g_return_val_if_fail (GTK_IS_TOOLBAR (widget), FALSE);
...@@ -328,11 +328,11 @@ gtk_toolbar_size_request (GtkWidget *widget, ...@@ -328,11 +328,11 @@ gtk_toolbar_size_request (GtkWidget *widget,
GtkRequisition *requisition) GtkRequisition *requisition)
{ {
GtkToolbar *toolbar; GtkToolbar *toolbar;
GList *children; GList *children;
GtkToolbarChild *child; GtkToolbarChild *child;
gint nbuttons; gint nbuttons;
gint button_maxw, button_maxh; gint button_maxw, button_maxh;
gint widget_maxw, widget_maxh; gint widget_maxw, widget_maxh;
g_return_if_fail (widget != NULL); g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TOOLBAR (widget)); g_return_if_fail (GTK_IS_TOOLBAR (widget));
...@@ -416,11 +416,11 @@ static void ...@@ -416,11 +416,11 @@ static void
gtk_toolbar_size_allocate (GtkWidget *widget, gtk_toolbar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation) GtkAllocation *allocation)
{ {
GtkToolbar *toolbar; GtkToolbar *toolbar;
GList *children; GList *children;
GtkToolbarChild *child; GtkToolbarChild *child;
GtkAllocation alloc; GtkAllocation alloc;
gint border_width; gint border_width;
g_return_if_fail (widget != NULL); g_return_if_fail (widget != NULL);
g_return_if_fail (GTK_IS_TOOLBAR (widget)); g_return_if_fail (GTK_IS_TOOLBAR (widget));
...@@ -455,6 +455,7 @@ gtk_toolbar_size_allocate (GtkWidget *widget, ...@@ -455,6 +455,7 @@ gtk_toolbar_size_allocate (GtkWidget *widget,
case GTK_TOOLBAR_CHILD_TOGGLEBUTTON: case GTK_TOOLBAR_CHILD_TOGGLEBUTTON:
if (!GTK_WIDGET_VISIBLE (child->widget)) if (!GTK_WIDGET_VISIBLE (child->widget))
break; break;
alloc.width = toolbar->button_maxw; alloc.width = toolbar->button_maxw;
alloc.height = toolbar->button_maxh; alloc.height = toolbar->button_maxh;
...@@ -475,6 +476,7 @@ gtk_toolbar_size_allocate (GtkWidget *widget, ...@@ -475,6 +476,7 @@ gtk_toolbar_size_allocate (GtkWidget *widget,
case GTK_TOOLBAR_CHILD_WIDGET: case GTK_TOOLBAR_CHILD_WIDGET:
if (!GTK_WIDGET_VISIBLE (child->widget)) if (!GTK_WIDGET_VISIBLE (child->widget))
break; break;
alloc.width = child->widget->requisition.width; alloc.width = child->widget->requisition.width;
alloc.height = child->widget->requisition.height; alloc.height = child->widget->requisition.height;
...@@ -514,8 +516,8 @@ gtk_toolbar_remove (GtkContainer *container, ...@@ -514,8 +516,8 @@ gtk_toolbar_remove (GtkContainer *container,
GtkWidget *widget) GtkWidget *widget)
{ {
GtkToolbar *toolbar; GtkToolbar *toolbar;
GList *children; GList *children;
GtkToolbarChild *child; GtkToolbarChild *child;
g_return_if_fail (container != NULL); g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_TOOLBAR (container)); g_return_if_fail (GTK_IS_TOOLBAR (container));
...@@ -553,8 +555,8 @@ gtk_toolbar_foreach (GtkContainer *container, ...@@ -553,8 +555,8 @@ gtk_toolbar_foreach (GtkContainer *container,
gpointer callback_data) gpointer callback_data)
{ {
GtkToolbar *toolbar; GtkToolbar *toolbar;
GList *children; GList *children;
GtkToolbarChild *child; GtkToolbarChild *child;
g_return_if_fail (container != NULL); g_return_if_fail (container != NULL);
g_return_if_fail (GTK_IS_TOOLBAR (container)); g_return_if_fail (GTK_IS_TOOLBAR (container));
...@@ -580,11 +582,11 @@ gtk_toolbar_append_item (GtkToolbar *toolbar, ...@@ -580,11 +582,11 @@ gtk_toolbar_append_item (GtkToolbar *toolbar,
GtkSignalFunc callback, GtkSignalFunc callback,
gpointer user_data) gpointer user_data)
{ {
return gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_BUTTON, return gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_BUTTON,
NULL, text, NULL, text,
tooltip_text, tooltip_private_text, tooltip_text, tooltip_private_text,
icon, callback, user_data, icon, callback, user_data,
toolbar->num_children); toolbar->num_children);
} }
GtkWidget * GtkWidget *
...@@ -596,11 +598,11 @@ gtk_toolbar_prepend_item (GtkToolbar *toolbar, ...@@ -596,11 +598,11 @@ gtk_toolbar_prepend_item (GtkToolbar *toolbar,
GtkSignalFunc callback, GtkSignalFunc callback,
gpointer user_data) gpointer user_data)
{ {
return gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_BUTTON, return gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_BUTTON,
NULL, text, NULL, text,
tooltip_text, tooltip_private_text, tooltip_text, tooltip_private_text,
icon, callback, user_data, icon, callback, user_data,
0); 0);
} }
GtkWidget * GtkWidget *
...@@ -613,42 +615,42 @@ gtk_toolbar_insert_item (GtkToolbar *toolbar, ...@@ -613,42 +615,42 @@ gtk_toolbar_insert_item (GtkToolbar *toolbar,
gpointer user_data, gpointer user_data,
gint position) gint position)
{ {
return gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_BUTTON, return gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_BUTTON,
NULL, text, NULL, text,
tooltip_text, tooltip_private_text, tooltip_text, tooltip_private_text,
icon, callback, user_data, icon, callback, user_data,
position); position);
} }
void void
gtk_toolbar_append_space (GtkToolbar *toolbar) gtk_toolbar_append_space (GtkToolbar *toolbar)
{ {
gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_SPACE, gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_SPACE,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
toolbar->num_children); toolbar->num_children);
} }
void void
gtk_toolbar_prepend_space (GtkToolbar *toolbar) gtk_toolbar_prepend_space (GtkToolbar *toolbar)
{ {
gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_SPACE, gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_SPACE,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
0); 0);
} }
void void
gtk_toolbar_insert_space (GtkToolbar *toolbar, gtk_toolbar_insert_space (GtkToolbar *toolbar,
gint position) gint position)
{ {
gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_SPACE, gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_SPACE,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
position); position);
} }
void void
...@@ -657,11 +659,11 @@ gtk_toolbar_append_widget (GtkToolbar *toolbar, ...@@ -657,11 +659,11 @@ gtk_toolbar_append_widget (GtkToolbar *toolbar,
const gchar *tooltip_text, const gchar *tooltip_text,
const gchar *tooltip_private_text) const gchar *tooltip_private_text)
{ {
gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_WIDGET, gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_WIDGET,
widget, NULL, widget, NULL,
tooltip_text, tooltip_private_text, tooltip_text, tooltip_private_text,
NULL, NULL, NULL, NULL, NULL, NULL,
toolbar->num_children); toolbar->num_children);
} }
void void
...@@ -670,11 +672,11 @@ gtk_toolbar_prepend_widget (GtkToolbar *toolbar, ...@@ -670,11 +672,11 @@ gtk_toolbar_prepend_widget (GtkToolbar *toolbar,
const gchar *tooltip_text, const gchar *tooltip_text,
const gchar *tooltip_private_text) const gchar *tooltip_private_text)
{ {
gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_WIDGET, gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_WIDGET,
widget, NULL, widget, NULL,
tooltip_text, tooltip_private_text, tooltip_text, tooltip_private_text,
NULL, NULL, NULL, NULL, NULL, NULL,
toolbar->num_children); toolbar->num_children);
} }
void void
...@@ -684,147 +686,157 @@ gtk_toolbar_insert_widget (GtkToolbar *toolbar, ...@@ -684,147 +686,157 @@ gtk_toolbar_insert_widget (GtkToolbar *toolbar,
const char *tooltip_private_text, const char *tooltip_private_text,
gint position) gint position)
{ {
gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_WIDGET, gtk_toolbar_insert_element (toolbar, GTK_TOOLBAR_CHILD_WIDGET,
widget, NULL, widget, NULL,
tooltip_text, tooltip_private_text, tooltip_text, tooltip_private_text,
NULL, NULL, NULL, NULL, NULL, NULL,
position); position);
} }
GtkWidget *gtk_toolbar_append_element (GtkToolbar *toolbar, GtkWidget *
GtkToolbarChildType type, gtk_toolbar_append_element (GtkToolbar *toolbar,
GtkWidget *widget, GtkToolbarChildType type,
const char *text, GtkWidget *widget,
const char *tooltip_text, const char *text,
const char *tooltip_private_text, const char *tooltip_text,
GtkWidget *icon, const char *tooltip_private_text,
GtkSignalFunc callback, GtkWidget *icon,
gpointer user_data) GtkSignalFunc callback,
{ gpointer user_data)
return gtk_toolbar_insert_element(toolbar, type, widget, text, {
tooltip_text, tooltip_private_text, return gtk_toolbar_insert_element (toolbar, type, widget, text,
icon, callback, user_data, tooltip_text, tooltip_private_text,
toolbar->num_children); icon, callback, user_data,
} toolbar->num_children);
}
GtkWidget *gtk_toolbar_prepend_element (GtkToolbar *toolbar,
GtkToolbarChildType type, GtkWidget *
GtkWidget *widget, gtk_toolbar_prepend_element (GtkToolbar *toolbar,
const char *text, GtkToolbarChildType type,
const char *tooltip_text, GtkWidget *widget,
const char *tooltip_private_text, const char *text,
GtkWidget *icon, const char *tooltip_text,
GtkSignalFunc callback, const char *tooltip_private_text,
gpointer user_data) GtkWidget *icon,
{ GtkSignalFunc callback,
return gtk_toolbar_insert_element(toolbar, type, widget, text, gpointer user_data)
tooltip_text, tooltip_private_text, {
icon, callback, user_data, 0); return gtk_toolbar_insert_element (toolbar, type, widget, text,
} tooltip_text, tooltip_private_text,
icon, callback, user_data, 0);
GtkWidget *gtk_toolbar_insert_element (GtkToolbar *toolbar, }
GtkToolbarChildType type,
GtkWidget *widget, GtkWidget *
const char *text, gtk_toolbar_insert_element (GtkToolbar *toolbar,
const char *tooltip_text, GtkToolbarChildType type,
const char *tooltip_private_text, GtkWidget *widget,
GtkWidget *icon, const char *text,
GtkSignalFunc callback, const char *tooltip_text,
gpointer user_data, const char *tooltip_private_text,
gint position) GtkWidget *icon,
{ GtkSignalFunc callback,
GtkToolbarChild *child; gpointer user_data,
GtkWidget *vbox; gint position)
{
g_return_val_if_fail (toolbar != NULL, NULL); GtkToolbarChild *child;
g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), NULL); GtkWidget *vbox;
child = g_new (GtkToolbarChild, 1); g_return_val_if_fail (toolbar != NULL, NULL);
child->type = type; g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), NULL);
child->icon = NULL; g_return_val_if_fail ((type != GTK_TOOLBAR_CHILD_WIDGET) || (widget != NULL), NULL);
child->label = NULL;
child = g_new (GtkToolbarChild, 1);
switch (type) { child->type = type;
case GTK_TOOLBAR_CHILD_SPACE: child->icon = NULL;
child->widget = NULL; child->label = NULL;
break;
case GTK_TOOLBAR_CHILD_WIDGET: switch (type)
child->widget = widget; {
break; case GTK_TOOLBAR_CHILD_SPACE:
case GTK_TOOLBAR_CHILD_BUTTON: child->widget = NULL;
case GTK_TOOLBAR_CHILD_TOGGLEBUTTON: break;
case GTK_TOOLBAR_CHILD_RADIOBUTTON:
if (type == GTK_TOOLBAR_CHILD_BUTTON) { case GTK_TOOLBAR_CHILD_WIDGET:
child->widget = gtk_button_new (); child->widget = widget;
} else if (type == GTK_TOOLBAR_CHILD_TOGGLEBUTTON) { break;
child->widget = gtk_toggle_button_new ();
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON(child->widget), case GTK_TOOLBAR_CHILD_BUTTON:
FALSE); case GTK_TOOLBAR_CHILD_TOGGLEBUTTON:
} else { case GTK_TOOLBAR_CHILD_RADIOBUTTON:
child->widget = if (type == GTK_TOOLBAR_CHILD_BUTTON)
gtk_radio_button_new( child->widget = gtk_button_new ();
widget else if (type == GTK_TOOLBAR_CHILD_TOGGLEBUTTON)
? gtk_radio_button_group(GTK_RADIO_BUTTON(widget)) {
: NULL); child->widget = gtk_toggle_button_new ();
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON(child->widget), gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (child->widget),
FALSE); FALSE);
}
else
{
child->widget = gtk_radio_button_new (widget
? gtk_radio_button_group (GTK_RADIO_BUTTON (widget))
: NULL);
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (child->widget), FALSE);
} }
vbox = gtk_vbox_new (FALSE, 0); if (callback)
gtk_container_add (GTK_CONTAINER (child->widget), vbox); gtk_signal_connect (GTK_OBJECT (child->widget), "clicked",
gtk_widget_show (vbox); callback, user_data);
if (icon) { vbox = gtk_vbox_new (FALSE, 0);
child->icon = GTK_WIDGET (icon); gtk_container_add (GTK_CONTAINER (child->widget), vbox);
gtk_box_pack_start (GTK_BOX (vbox), child->icon, FALSE, FALSE, 0); gtk_widget_show (vbox);
if (toolbar->style != GTK_TOOLBAR_TEXT)
gtk_widget_show (child->icon); if (icon)
{
child->icon = GTK_WIDGET (icon);
gtk_box_pack_start (GTK_BOX (vbox), child->icon, FALSE, FALSE, 0);
if (toolbar->style != GTK_TOOLBAR_TEXT)
gtk_widget_show (child->icon);
} }
if (text) { if (text)
child->label = gtk_label_new (text); {
gtk_box_pack_start (GTK_BOX (vbox), child->label, FALSE, FALSE, 0); child->label = gtk_label_new (text);
if (toolbar->style != GTK_TOOLBAR_ICONS) gtk_box_pack_start (GTK_BOX (vbox), child->label, FALSE, FALSE, 0);
gtk_widget_show (child->label);