new settings menu in gui
[drnoksnes] / gui / controls.c
1 /*
2 * This file is part of DrNokSnes
3 *
4 * Copyright (C) 2009 Javier S. Pedro <maemo@javispedro.com>
5 *
6 * This software is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * as published by the Free Software Foundation; either version 2.1 of
9 * the License, or (at your option) any later version.
10 *
11 * This software is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this software; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 *
21 */
22
23 #include <gtk/gtk.h>
24 #include <gconf/gconf.h>
25 #include <gconf/gconf-client.h>
26
27 #include "../platform/hgw.h"
28 #include "plugin.h"
29
30 static GtkDialog* dialog;
31 static GtkTreeView* list;
32
33 static void cb_dialog_response(GtkWidget * button, gpointer data)
34 {
35         gtk_widget_destroy(GTK_WIDGET(dialog));
36 }
37
38 void controls_dialog(GtkWindow* parent)
39 {
40         dialog = GTK_DIALOG(gtk_dialog_new_with_buttons("Controls",
41                 parent, GTK_DIALOG_MODAL,
42                 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL));
43
44         list = GTK_TREE_VIEW(gtk_tree_view_new());
45
46         gtk_box_pack_start_defaults(GTK_BOX(dialog->vbox), GTK_WIDGET(list));
47
48         g_signal_connect(G_OBJECT(dialog), "response",
49                                         G_CALLBACK (cb_dialog_response), NULL);
50
51         gtk_window_resize(GTK_WINDOW(dialog), 600, 300);
52         gtk_widget_show_all(GTK_WIDGET(dialog));
53 }
54