]> Pileus Git - ~andy/gtk/blob - gtk/gtkdialog.c
55da2d13713e427d112f753271a02a2cc90e4c12
[~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 Free
16  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  */
18 #include "gtkbutton.h"
19 #include "gtkdialog.h"
20 #include "gtkhbox.h"
21 #include "gtkhseparator.h"
22 #include "gtkvbox.h"
23
24
25 static void gtk_dialog_class_init (GtkDialogClass *klass);
26 static void gtk_dialog_init       (GtkDialog      *dialog);
27
28
29 guint
30 gtk_dialog_get_type ()
31 {
32   static guint dialog_type = 0;
33
34   if (!dialog_type)
35     {
36       GtkTypeInfo dialog_info =
37       {
38         "GtkDialog",
39         sizeof (GtkDialog),
40         sizeof (GtkDialogClass),
41         (GtkClassInitFunc) gtk_dialog_class_init,
42         (GtkObjectInitFunc) gtk_dialog_init,
43         (GtkArgFunc) NULL,
44       };
45
46       dialog_type = gtk_type_unique (gtk_window_get_type (), &dialog_info);
47     }
48
49   return dialog_type;
50 }
51
52 static void
53 gtk_dialog_class_init (GtkDialogClass *class)
54 {
55 }
56
57 static void
58 gtk_dialog_init (GtkDialog *dialog)
59 {
60   GtkWidget *separator;
61
62   dialog->vbox = gtk_vbox_new (FALSE, 0);
63   gtk_container_add (GTK_CONTAINER (dialog), dialog->vbox);
64   gtk_widget_show (dialog->vbox);
65
66   dialog->action_area = gtk_hbox_new (TRUE, 5);
67   gtk_container_border_width (GTK_CONTAINER (dialog->action_area), 10);
68   gtk_box_pack_end (GTK_BOX (dialog->vbox), dialog->action_area, FALSE, TRUE, 0);
69   gtk_widget_show (dialog->action_area);
70
71   separator = gtk_hseparator_new ();
72   gtk_box_pack_end (GTK_BOX (dialog->vbox), separator, FALSE, TRUE, 0);
73   gtk_widget_show (separator);
74 }
75
76 GtkWidget*
77 gtk_dialog_new ()
78 {
79   return GTK_WIDGET (gtk_type_new (gtk_dialog_get_type ()));
80 }