]> Pileus Git - ~andy/gtk/blob - gtk/gtkdialog.c
Added notice to look in AUTHORS and ChangeLog files for a list of changes.
[~andy/gtk] / gtk / gtkdialog.c
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-1999.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
25  */
26
27 #include "gtkbutton.h"
28 #include "gtkdialog.h"
29 #include "gtkhbox.h"
30 #include "gtkhseparator.h"
31 #include "gtkvbox.h"
32
33
34 static void gtk_dialog_class_init (GtkDialogClass *klass);
35 static void gtk_dialog_init       (GtkDialog      *dialog);
36
37
38 GtkType
39 gtk_dialog_get_type (void)
40 {
41   static GtkType dialog_type = 0;
42
43   if (!dialog_type)
44     {
45       static const GtkTypeInfo dialog_info =
46       {
47         "GtkDialog",
48         sizeof (GtkDialog),
49         sizeof (GtkDialogClass),
50         (GtkClassInitFunc) gtk_dialog_class_init,
51         (GtkObjectInitFunc) gtk_dialog_init,
52         /* reserved_1 */ NULL,
53         /* reserved_2 */ NULL,
54         (GtkClassInitFunc) NULL,
55       };
56
57       dialog_type = gtk_type_unique (GTK_TYPE_WINDOW, &dialog_info);
58     }
59
60   return dialog_type;
61 }
62
63 static void
64 gtk_dialog_class_init (GtkDialogClass *class)
65 {
66 }
67
68 static void
69 gtk_dialog_init (GtkDialog *dialog)
70 {
71   GtkWidget *separator;
72
73   dialog->vbox = gtk_vbox_new (FALSE, 0);
74   gtk_container_add (GTK_CONTAINER (dialog), dialog->vbox);
75   gtk_widget_show (dialog->vbox);
76
77   dialog->action_area = gtk_hbox_new (TRUE, 5);
78   gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 10);
79   gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->action_area, FALSE, TRUE, 0);
80   gtk_widget_show (dialog->action_area);
81
82   separator = gtk_hseparator_new ();
83   gtk_box_pack_end (GTK_BOX (dialog->vbox), separator, FALSE, TRUE, 0);
84   gtk_widget_show (separator);
85 }
86
87 GtkWidget*
88 gtk_dialog_new (void)
89 {
90   return GTK_WIDGET (gtk_type_new (GTK_TYPE_DIALOG));
91 }