Freeciv-3.3
Loading...
Searching...
No Matches
inputdlg.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <stdio.h>
19
20#include <gtk/gtk.h>
21
22/* utility */
23#include "fcintl.h"
24#include "log.h"
25#include "mem.h"
26
27/* client/gui-gtk-3.22 */
28#include "gui_main.h"
29#include "gui_stuff.h"
30
31#include "inputdlg.h"
32
37
38/**********************************************************************/
42 gpointer data)
43{
45 struct input_dialog_data *cb = data;
46
49
50 /* Any response is final */
52 FC_FREE(cb);
53}
54
55/**********************************************************************/
62
63/**********************************************************************/
67 const char *text, const char *postinputtest,
70{
71 GtkWidget *shell, *label, *input;
72 struct input_dialog_data *cb = fc_malloc(sizeof(struct input_dialog_data));
73
76
78 parent,
80 _("_Cancel"), GTK_RESPONSE_CANCEL,
81 _("_OK"), GTK_RESPONSE_OK,
82 NULL);
88
89 label = gtk_frame_new(text);
90 /* Should use gtk_dialog_get_content_area() instead of ->vbox, but that
91 * requires at least gtk+-2.14.0 */
93
99
102
103 return shell;
104}
char * incite_cost
Definition comments.c:76
#define _(String)
Definition fcintl.h:67
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
Definition gui_stuff.c:287
static void input_dialog_close(GtkDialog *shell, gpointer data)
Definition inputdlg.c:58
GtkWidget * input_dialog_create(GtkWindow *parent, const char *dialogname, const char *text, const char *postinputtest, input_dialog_callback_t response_callback, gpointer response_cli_data)
Definition inputdlg.c:66
static void input_dialog_response(GtkDialog *shell, gint response, gpointer data)
Definition inputdlg.c:41
void(* input_dialog_callback_t)(gpointer response_cli_data, gint response, const char *input)
Definition inputdlg.h:18
static struct gui_dialog * shell
Definition messagedlg.c:39
#define FC_FREE(ptr)
Definition mem.h:41
#define fc_malloc(sz)
Definition mem.h:34
input_dialog_callback_t response_callback
Definition inputdlg.c:34
gpointer response_cli_data
Definition inputdlg.c:35
#define TRUE
Definition support.h:46