2 PrtView plugin for GtkRadiant
3 Copyright (C) 2001 Geoffrey Dewan, Loki software and qeradiant.com
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #include "AboutDialog.h"
22 #include <gtkutil/pointer.h>
23 #include <uilib/uilib.h>
25 #include "gtkutil/pointer.h"
28 #include "ConfigDialog.h"
30 static void dialog_button_callback( GtkWidget *widget, gpointer data ){
34 parent = gtk_widget_get_toplevel( widget );
35 loop = (int*)g_object_get_data( G_OBJECT( parent ), "loop" );
36 ret = (int*)g_object_get_data( G_OBJECT( parent ), "ret" );
39 *ret = gpointer_to_int( data );
42 static gint dialog_delete_callback( GtkWidget *widget, GdkEvent* event, gpointer data ){
45 gtk_widget_hide( widget );
46 loop = (int*)g_object_get_data( G_OBJECT( widget ), "loop" );
53 GtkWidget *vbox, *label;
54 int loop = 1, ret = IDCANCEL;
56 auto dlg = ui::Window( ui::window_type::TOP );
57 gtk_window_set_title( GTK_WINDOW( dlg ), "About Portal Viewer" );
58 dlg.connect( "delete_event",
59 G_CALLBACK( dialog_delete_callback ), NULL );
60 dlg.connect( "destroy",
61 G_CALLBACK( gtk_widget_destroy ), NULL );
62 g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
63 g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
65 auto hbox = ui::HBox( FALSE, 10 );
68 gtk_container_set_border_width( GTK_CONTAINER( hbox ), 10 );
70 char const *label_text = "Version 1.000\n\n"
71 "Gtk port by Leonardo Zide\nleo@lokigames.com\n\n"
72 "Written by Geoffrey DeWan\ngdewan@prairienet.org\n\n"
73 "Built against NetRadiant " RADIANT_VERSION "\n"
75 gtk_widget_show( label );
76 gtk_box_pack_start( GTK_BOX( hbox ), label, TRUE, TRUE, 0 );
77 gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_LEFT );
79 vbox = ui::VBox( FALSE, 0 );
80 gtk_widget_show( vbox );
81 gtk_box_pack_start( GTK_BOX( hbox ), vbox, FALSE, FALSE, 0 );
83 auto button = ui::Button( "OK" );
84 gtk_widget_show( button );
85 gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 );
86 button.connect( "clicked",
87 G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
88 gtk_widget_set_size_request( button, 60, -1 );
91 gtk_widget_show( dlg );
96 gtk_grab_remove( dlg );
97 gtk_widget_destroy( dlg );
101 /////////////////////////////////////////////////////////////////////////////
102 // CAboutDialog message handlers