added the widget living in the right_vbox to the GimpBrowser struct

2005-06-23  Michael Natterer  <mitch@gimp.org>

	* libgimpwidgets/gimpbrowser.[ch]: added the widget living in the
	right_vbox to the GimpBrowser struct instead of attaching it to
	the browser.
This commit is contained in:
Michael Natterer 2005-06-23 11:28:15 +00:00 committed by Michael Natterer
parent 3571a5802e
commit 938f24fd58
3 changed files with 29 additions and 24 deletions

View File

@ -1,3 +1,9 @@
2005-06-23 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpbrowser.[ch]: added the widget living in the
right_vbox to the GimpBrowser struct instead of attaching it to
the browser.
2005-06-22 Sven Neumann <sven@gimp.org>
* plug-ins/FractalExplorer/FractalExplorer.c: applied a patch from

View File

@ -238,48 +238,40 @@ void
gimp_browser_set_widget (GimpBrowser *browser,
GtkWidget *widget)
{
GtkWidget *child;
g_return_if_fail (GIMP_IS_BROWSER (browser));
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (widget == NULL || GTK_IS_WIDGET (widget));
child = g_object_get_data (G_OBJECT (browser->right_vbox), "child");
if (widget == browser->right_widget)
return;
if (child)
gtk_container_remove (GTK_CONTAINER (browser->right_vbox), child);
if (browser->right_widget)
gtk_container_remove (GTK_CONTAINER (browser->right_vbox),
browser->right_widget);
gtk_box_pack_start (GTK_BOX (browser->right_vbox), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
browser->right_widget = widget;
g_object_set_data (G_OBJECT (browser->right_vbox), "child", widget);
if (widget)
{
gtk_box_pack_start (GTK_BOX (browser->right_vbox), widget,
FALSE, FALSE, 0);
gtk_widget_show (widget);
}
}
void
gimp_browser_show_message (GimpBrowser *browser,
const gchar *message)
{
GtkWidget *child;
g_return_if_fail (GIMP_IS_BROWSER (browser));
g_return_if_fail (message != NULL);
child = g_object_get_data (G_OBJECT (browser->right_vbox), "child");
if (GTK_IS_LABEL (child))
if (GTK_IS_LABEL (browser->right_widget))
{
gtk_label_set_text (GTK_LABEL (child), message);
gtk_label_set_text (GTK_LABEL (browser->right_widget), message);
}
else
{
if (child)
gtk_container_remove (GTK_CONTAINER (browser->right_vbox), child);
child = gtk_label_new (message);
gtk_box_pack_start (GTK_BOX (browser->right_vbox), child,
FALSE, FALSE, 0);
gtk_widget_show (child);
g_object_set_data (G_OBJECT (browser->right_vbox), "child", child);
gimp_browser_set_widget (browser, gtk_label_new (message));
}
while (gtk_events_pending ())

View File

@ -55,6 +55,7 @@ struct _GimpBrowser
GtkWidget *count_label;
GtkWidget *right_vbox;
GtkWidget *right_widget;
};
struct _GimpBrowserClass
@ -64,6 +65,12 @@ struct _GimpBrowserClass
void (* search) (GimpBrowser *browser,
const gchar *search_string,
gint search_type);
/* Padding for future expansion */
void (* _gimp_reserved1) (void);
void (* _gimp_reserved2) (void);
void (* _gimp_reserved3) (void);
void (* _gimp_reserved4) (void);
};