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;
59 Widget tagsShell, editTagsShell;
62 # define _(s) gettext (s)
63 # define N_(s) gettext_noop (s)
76 TagsPopUp(char *tags, char *msg)
83 //void EditTagsCallback(w, client_data, call_data)
85 // XtPointer client_data, call_data;
93 // XtSetArg(args[j], XtNlabel, &name); j++;
94 // XtGetValues(w, args, j);
97 // if (strcmp(name, _("ok")) == 0) {
98 // /* ok: get values, update, close */
99 // textw = XtNameToWidget(editTagsShell, "*form.text");
101 // XtSetArg(args[j], XtNstring, &val); j++;
102 // XtGetValues(textw, args, j);
103 // ReplaceTags(val, &gameInfo);
105 // } else if (strcmp(name, _("cancel")) == 0) {
108 // } else if (strcmp(name, _("clear")) == 0) {
110 // textw = XtNameToWidget(editTagsShell, "*form.text");
111 // XtCallActionProc(textw, "select-all", NULL, NULL, 0);
112 // XtCallActionProc(textw, "kill-selection", NULL, NULL, 0);
123 /* add the text to the dialog */
125 label = gtk_label_new (tags);
127 /* remove old tags that we already added */
128 gtk_container_foreach(GTK_CONTAINER (GUI_EditTagsTextArea),G_CALLBACK (gtk_widget_destroy),NULL);
130 /* TODO replace this with a version where you can edit and a callback for the edit button that saves the new tags*/
131 gtk_container_add (GTK_CONTAINER (GUI_EditTagsTextArea), label);
134 gtk_widget_show_all (GUI_EditTags);
140 EditTagsProc(object, user_data)
144 /* always call EditTagsEvent, which calls the function to popup the window */
150 EditTagsHideProc(object, user_data)
154 /* hide everything */
155 gtk_widget_hide_all(GUI_EditTags);