1
/* GTK - The GIMP Toolkit
2
* Copyright (C) 2001 CodeFactory AB
3
* Copyright (C) 2001, 2002 Anders Carlsson
4
* Copyright (C) 2003, 2004 Matthias Clasen <mclasen@redhat.com>
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Library General Public
8
* License as published by the Free Software Foundation; either
9
* version 2 of the License, or (at your option) any later version.
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Library General Public License for more details.
16
* You should have received a copy of the GNU Library General Public
17
* License along with this library; if not, write to the
18
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
* Boston, MA 02111-1307, USA.
23
* Author: Anders Carlsson <andersca@gnome.org>
25
* Modified by the GTK+ Team and others 1997-2004. See the AUTHORS
26
* file for a list of people on the GTK+ Team. See the ChangeLog
27
* files for a list of changes. These files are distributed with
28
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
31
#include "widgets-utils.h"
34
close_cb (GtkWidget *about)
36
GtkAboutDialogPrivate *priv = about->priv;
38
gtk_widget_hide (about);
42
* gtk_show_about_dialog:
43
* @parent: (allow-none): transient parent, or %NULL for none
44
* @first_property_name: the name of the first property
45
* @Varargs: value of first property, followed by more properties, %NULL-terminated
47
* This is a convenience function for showing an application's about box.
48
* The constructed dialog is associated with the parent window and
49
* reused for future invocations of this function.
54
granite_widgets_show_about_dialog (GtkWindow *parent,
55
const gchar *first_property_name,
58
static GtkWidget *global_about_dialog = NULL;
59
GtkWidget *dialog = NULL;
63
dialog = g_object_get_data (G_OBJECT (parent), "gtk-about-dialog");
65
dialog = global_about_dialog;
69
//dialog = gtk_about_dialog_new ();
70
dialog = granite_widgets_about_dialog_new ();
71
g_object_ref_sink (dialog);
73
g_signal_connect (dialog, "delete-event",
74
G_CALLBACK (gtk_widget_hide_on_delete), NULL);
76
/* Close dialog on user response */
77
g_signal_connect (dialog, "response",
78
G_CALLBACK (close_cb), NULL);
80
va_start (var_args, first_property_name);
81
g_object_set_valist (G_OBJECT (dialog), first_property_name, var_args);
86
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
87
gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
88
gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
89
g_object_set_data_full (G_OBJECT (parent),
91
dialog, g_object_unref);
94
global_about_dialog = dialog;
98
gtk_window_present (GTK_WINDOW (dialog));