2 * xedittags.c -- Tags edit window, part of X front end for XBoard
4 * Copyright 1995,2009 Free Software Foundation, Inc.
6 * ------------------------------------------------------------------------
8 * GNU XBoard is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or (at
11 * your option) any later version.
13 * GNU XBoard is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see http://www.gnu.org/licenses/. *
21 *------------------------------------------------------------------------
22 ** See the file ChangeLog for a revision history. */
29 #include <sys/types.h>
36 #else /* not STDC_HEADERS */
37 extern char *getenv();
40 # else /* not HAVE_STRING_H */
42 # endif /* not HAVE_STRING_H */
43 #endif /* not STDC_HEADERS */
53 #include "xedittags.h"
56 extern GtkWidget *GUI_EditTags;
57 extern GtkWidget *GUI_EditTagsTextArea;
61 # define _(s) gettext (s)
62 # define N_(s) gettext_noop (s)
75 TagsPopUp(char *tags, char *msg)
82 //void EditTagsCallback(w, client_data, call_data)
84 // XtPointer client_data, call_data;
92 // XtSetArg(args[j], XtNlabel, &name); j++;
93 // XtGetValues(w, args, j);
96 // if (strcmp(name, _("ok")) == 0) {
97 // /* ok: get values, update, close */
98 // textw = XtNameToWidget(editTagsShell, "*form.text");
100 // XtSetArg(args[j], XtNstring, &val); j++;
101 // XtGetValues(textw, args, j);
102 // ReplaceTags(val, &gameInfo);
104 // } else if (strcmp(name, _("cancel")) == 0) {
107 // } else if (strcmp(name, _("clear")) == 0) {
109 // textw = XtNameToWidget(editTagsShell, "*form.text");
110 // XtCallActionProc(textw, "select-all", NULL, NULL, 0);
111 // XtCallActionProc(textw, "kill-selection", NULL, NULL, 0);
122 /* add the text to the dialog */
124 label = gtk_label_new (tags);
126 /* remove old tags that we already added */
127 gtk_container_foreach(GTK_CONTAINER (GUI_EditTagsTextArea),G_CALLBACK (gtk_widget_destroy),NULL);
129 /* TODO replace this with a version where you can edit and a callback for the edit button that saves the new tags*/
130 gtk_container_add (GTK_CONTAINER (GUI_EditTagsTextArea), label);
133 gtk_widget_show_all (GUI_EditTags);
139 EditTagsProc(object, user_data)
143 /* always call EditTagsEvent, which calls the function to popup the window */
149 EditTagsHideProc(object, user_data)
153 /* hide everything */
154 gtk_widget_hide_all(GUI_EditTags);