[gimp] Make gimp_statusbar_new() a void function and set a shell dynamically



commit fc75f38c0300dd447d85f95ad5a592aff6f72003
Author: Michael Natterer <mitch gimp org>
Date:   Thu Sep 24 09:40:32 2009 +0200

    Make gimp_statusbar_new() a void function and set a shell dynamically

 app/display/gimpimagewindow.c |    5 +++--
 app/display/gimpstatusbar.c   |   12 ++----------
 app/display/gimpstatusbar.h   |    3 ++-
 3 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index 4343e7d..7263032 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -182,8 +182,7 @@ gimp_image_window_constructor (GType                  type,
                         NULL);
     }
 
-  /* FIXME display shell */
-  window->statusbar = gimp_statusbar_new (GIMP_DISPLAY_SHELL (window));
+  window->statusbar = gimp_statusbar_new ();
   gimp_help_set_help_data (window->statusbar, NULL,
                            GIMP_HELP_IMAGE_WINDOW_STATUS_BAR);
   gtk_box_pack_end (GTK_BOX (window->main_vbox), window->statusbar,
@@ -399,6 +398,8 @@ gimp_image_window_set_active_display (GimpImageWindow *window,
 
   active_shell = GIMP_DISPLAY_SHELL (window->active_display->shell);
 
+  gimp_statusbar_set_shell (GIMP_STATUSBAR (window->statusbar), active_shell);
+
   g_signal_connect (active_shell, "scaled",
                     G_CALLBACK (gimp_image_window_shell_scaled),
                     window);
diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c
index 94c0288..5a41f22 100644
--- a/app/display/gimpstatusbar.c
+++ b/app/display/gimpstatusbar.c
@@ -649,17 +649,9 @@ gimp_statusbar_update (GimpStatusbar *statusbar)
 /*  public functions  */
 
 GtkWidget *
-gimp_statusbar_new (GimpDisplayShell *shell)
+gimp_statusbar_new (void)
 {
-  GimpStatusbar *statusbar;
-
-  g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), NULL);
-
-  statusbar = g_object_new (GIMP_TYPE_STATUSBAR, NULL);
-
-  gimp_statusbar_set_shell (statusbar, shell);
-
-  return GTK_WIDGET (statusbar);
+  return g_object_new (GIMP_TYPE_STATUSBAR, NULL);
 }
 
 void
diff --git a/app/display/gimpstatusbar.h b/app/display/gimpstatusbar.h
index bebc2ed..f31b9c7 100644
--- a/app/display/gimpstatusbar.h
+++ b/app/display/gimpstatusbar.h
@@ -72,7 +72,8 @@ struct _GimpStatusbarClass
 
 
 GType       gimp_statusbar_get_type         (void) G_GNUC_CONST;
-GtkWidget * gimp_statusbar_new              (GimpDisplayShell    *shell);
+GtkWidget * gimp_statusbar_new              (void);
+
 void        gimp_statusbar_set_shell        (GimpStatusbar       *statusbar,
                                              GimpDisplayShell    *shell);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]