X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fhelper.c;h=30f7da1f04cc6209bb4dd2517e6fad8721f089c9;hb=d46430e7458fcd65dfdf7928f52f2d06fa60127d;hp=3c7d7bcff072df218068595d6c8231a4535e5f0b;hpb=376bc1e2594564c432857c50f2f779093ce70710;p=pspp-builds.git diff --git a/src/ui/gui/helper.c b/src/ui/gui/helper.c index 3c7d7bcf..30f7da1f 100644 --- a/src/ui/gui/helper.c +++ b/src/ui/gui/helper.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007, 2009, 2010, 2011 Free Software Foundation + Copyright (C) 2007, 2009, 2010, 2011, 2012 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -111,58 +111,6 @@ text_to_value (const gchar *text, } -GtkBuilder * -builder_new_real (const gchar *name) -{ - GtkBuilder *builder = gtk_builder_new (); - - GError *err = NULL; - if ( ! gtk_builder_add_from_file (builder, name, &err)) - { - g_critical ("Couldnt open user interface file %s: %s", name, err->message); - g_clear_error (&err); - } - - return builder; -} - - -GObject * -get_object_assert (GtkBuilder *builder, const gchar *name, GType type) -{ - GObject *o = NULL; - g_assert (name); - - o = gtk_builder_get_object (builder, name); - - if ( !o ) - g_critical ("Object `%s' could not be found\n", name); - else if ( ! g_type_is_a (G_OBJECT_TYPE (o), type)) - { - g_critical ("Object `%s' was expected to have type %s, but in fact has type %s", - name, g_type_name (type), G_OBJECT_TYPE_NAME (o)); - } - - return o; -} - - -GtkAction * -get_action_assert (GtkBuilder *builder, const gchar *name) -{ - return GTK_ACTION (get_object_assert (builder, name, GTK_TYPE_ACTION)); -} - -GtkWidget * -get_widget_assert (GtkBuilder *builder, const gchar *name) -{ - GtkWidget *w = GTK_WIDGET (get_object_assert (builder, name, GTK_TYPE_WIDGET)); - - g_object_set (w, "name", name, NULL); - - return w; -} - /* This function must be used whenever a filename generated by glib, (eg, from gtk_file_chooser_get_filename) and passed to the C library, (eg through a pspp syntax string).