~ubuntu-branches/ubuntu/vivid/gdis/vivid

« back to all changes in this revision

Viewing changes to gui_help.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2006-11-18 23:41:00 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20061118234100-85eekne977b0eznj
Tags: 0.89-1ubuntu1
* Merge from Debian unstable. Ubuntu changes are as follows:
* Add desktop file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
Copyright (C) 2003 by Sean David Fleming
3
3
 
4
 
sean@power.curtin.edu.au
 
4
sean@ivec.org
5
5
 
6
6
This program is free software; you can redistribute it and/or
7
7
modify it under the terms of the GNU General Public License
23
23
#include <stdio.h>
24
24
#include <stdlib.h>
25
25
#include <string.h>
 
26
#ifdef __APPLE__
 
27
#include <OpenGL/gl.h>
 
28
#else
26
29
#include <GL/gl.h>
 
30
#endif
27
31
 
28
32
#include "gdis.h"
29
 
#include "gtkshorts.h"
 
33
#include "shortcuts.h"
30
34
#include "dialog.h"
 
35
#include "scan.h"
 
36
#include "parse.h"
31
37
#include "interface.h"
32
 
 
33
 
/****************/
34
 
/* about dialog */
35
 
/****************/
36
 
void about(void)
37
 
{
38
 
gint doc;
 
38
#include "gui_image.h"
 
39
 
 
40
extern struct sysenv_pak sysenv;
 
41
 
 
42
#define MANUAL_FILE "gdis.manual"
 
43
 
 
44
GtkTextTag *help_tag_bold, *help_tag_italic, *help_tag_invisible, *help_tag_fixed;
 
45
 
 
46
/**********************/
 
47
/* add a single topic */
 
48
/**********************/
 
49
void help_topic_new(gchar *topic, gchar *text)
 
50
{
 
51
if (topic)
 
52
  {
 
53
  if (text)
 
54
    g_hash_table_insert(sysenv.manual, g_strdup(topic), g_strdup(text));
 
55
  else
 
56
    g_hash_table_insert(sysenv.manual, g_strdup(topic), "<empty>\n");
 
57
  }
 
58
else
 
59
  g_hash_table_insert(sysenv.manual, "error", "manual file was probably not found\n");
 
60
}
 
61
 
 
62
/**************************************************/
 
63
/* load the help file and process the manual text */
 
64
/**************************************************/
 
65
void help_init(void)
 
66
{
 
67
gint n;
 
68
gchar *filename, *line, *topic;
 
69
gpointer scan;
 
70
GString *buffer;
 
71
 
 
72
/* hash table with topic label as the key */
 
73
sysenv.manual = g_hash_table_new(g_str_hash, g_str_equal);
 
74
 
 
75
/* open the manual file for scanning */
 
76
filename = g_build_filename(sysenv.gdis_path, MANUAL_FILE, NULL);
 
77
printf("scanning: %s\n", filename);
 
78
scan = scan_new(filename);
 
79
g_free(filename);
 
80
if (!scan)
 
81
  {
 
82
  help_topic_new(NULL, NULL);
 
83
  return;
 
84
  }
 
85
 
 
86
/* process the manual file */
 
87
topic=NULL;
 
88
buffer = g_string_new(NULL);
 
89
line = scan_get_line(scan);
 
90
while (!scan_complete(scan))
 
91
  {
 
92
  if (g_strncasecmp(line, "%topic ", 7) == 0)
 
93
    {
 
94
/* add any old data */
 
95
    if (topic && buffer->len)
 
96
      {
 
97
      help_topic_new(topic, buffer->str);
 
98
      buffer = g_string_set_size(buffer, 0);
 
99
      g_free(topic);
 
100
      }
 
101
/* remove trailing <cr> */
 
102
    n = strlen(&line[7]);
 
103
    topic = g_strndup(&line[7], n-1);
 
104
    }
 
105
  else
 
106
    {
 
107
/* append everything that's not a topic to the current buffer */
 
108
    if (topic)
 
109
      g_string_append(buffer, line);
 
110
    }
 
111
 
 
112
  line = scan_get_line(scan);
 
113
  }
 
114
 
 
115
/* done - add the last topic found */
 
116
if (topic)
 
117
  help_topic_new(topic, buffer->str);
 
118
 
 
119
g_string_free(buffer, TRUE);
 
120
g_free(topic);
 
121
 
 
122
scan_free(scan);
 
123
}
 
124
 
 
125
/**********************/
 
126
/* add a single entry */
 
127
/**********************/
 
128
void gui_help_populate(gpointer key, gpointer value, gpointer data)
 
129
{
 
130
gchar *topic = key;
 
131
GtkTreeIter iter;
 
132
GtkListStore *list = data;
 
133
 
 
134
gtk_list_store_append(list, &iter);
 
135
gtk_list_store_set(list, &iter, 0, topic, -1);
 
136
}
 
137
 
 
138
/****************************************/
 
139
/* fill out the available manual topics */
 
140
/****************************************/
 
141
void gui_help_refresh(GtkListStore *list)
 
142
{
 
143
g_assert(sysenv.manual != NULL);
 
144
 
 
145
gtk_list_store_clear(list);
 
146
g_hash_table_foreach(sysenv.manual, gui_help_populate, list);
 
147
}
 
148
 
 
149
/*********************************************/
 
150
/* process and display appropriate help text */
 
151
/*********************************************/
 
152
void gui_help_topic_show(GtkTextBuffer *buffer, gchar *source)
 
153
{
 
154
gint i, j, n, start, stop;
 
155
gchar *text;
 
156
GdkPixbuf *pixbuf;
 
157
GtkTextIter a, b;
 
158
 
 
159
/* initialize help tags */
 
160
if (!help_tag_bold)
 
161
  help_tag_bold = gtk_text_buffer_create_tag(buffer,
 
162
                                            "bold",
 
163
                                            "weight", PANGO_WEIGHT_BOLD,
 
164
                                            NULL);
 
165
 
 
166
if (!help_tag_italic)
 
167
  help_tag_italic = gtk_text_buffer_create_tag(buffer,
 
168
                                              "italic",
 
169
                                              "style", PANGO_STYLE_ITALIC,
 
170
                                              NULL);
 
171
 
 
172
/* invisible tag not implemented as of GTK 2.2 */
 
173
/*
 
174
if (!help_tag_invisible)
 
175
  help_tag_invisible = gtk_text_buffer_create_tag(buffer,
 
176
                                                 "invisible",
 
177
                                                 "invisible",
 
178
                                                  TRUE,
 
179
                                                  NULL);
 
180
*/
 
181
 
 
182
/* FIXME - hack due to above */
 
183
if (!help_tag_invisible)
 
184
  {
 
185
  GdkColor white = {0, 65535, 65535, 65535};
 
186
  help_tag_invisible = gtk_text_buffer_create_tag(buffer,
 
187
                                                 "invisible",
 
188
                                                 "foreground-gdk",
 
189
                                                  &white,
 
190
                                                  NULL);
 
191
  }
 
192
 
 
193
if (!help_tag_fixed)
 
194
  {
 
195
  help_tag_fixed = gtk_text_buffer_create_tag(buffer,
 
196
                                              "fixed",
 
197
                                              "font", "Fixed 10",
 
198
                                              NULL);
 
199
  }
 
200
 
 
201
/*
 
202
tag_bold = gtk_text_buffer_create_tag(buffer, "bold", "style", PANGO_WEIGHT_OBLIQUE, NULL);
 
203
*/
 
204
 
 
205
gtk_text_buffer_set_text(buffer, source, -1);
 
206
 
 
207
n = strlen(source);
 
208
start = i = 0;
 
209
stop = -1;
 
210
while (i<n)
 
211
  {
 
212
/* search for special tags */
 
213
  if (source[i] == '\\')
 
214
    {
 
215
/* process the tag */
 
216
    switch (source[i+1])
 
217
      {
 
218
/* header */
 
219
      case 'h':
 
220
/* make the tag invisible */
 
221
        gtk_text_buffer_get_iter_at_offset(buffer, &a, i);
 
222
        gtk_text_buffer_get_iter_at_offset(buffer, &b, i+3);
 
223
        gtk_text_buffer_apply_tag(buffer, help_tag_invisible, &a, &b);
 
224
        a = b;
 
225
/* apply the bold tag to the rest of the line */
 
226
        stop = -1;
 
227
        for (j=i+3 ; j<n ; j++)
 
228
          {
 
229
          if (source[j] == '\n')
 
230
            {
 
231
            stop = j;
 
232
            break;
 
233
            }
 
234
          }
 
235
        if (stop < 0)
 
236
          stop = n;
 
237
        gtk_text_buffer_get_iter_at_offset(buffer, &b, stop);
 
238
        gtk_text_buffer_apply_tag(buffer, help_tag_bold, &a, &b);
 
239
        i = stop;
 
240
        break;
 
241
 
 
242
/* italics */
 
243
      case 'i':
 
244
/* make the tag invisible */
 
245
        gtk_text_buffer_get_iter_at_offset(buffer, &a, i);
 
246
        gtk_text_buffer_get_iter_at_offset(buffer, &b, i+3);
 
247
        gtk_text_buffer_apply_tag(buffer, help_tag_invisible, &a, &b);
 
248
        a = b;
 
249
/* apply the bold tag to the rest of the line */
 
250
        stop = -1;
 
251
        for (j=i+3 ; j<n ; j++)
 
252
          {
 
253
          if (source[j] == '\n')
 
254
            {
 
255
            stop = j;
 
256
            break;
 
257
            }
 
258
          }
 
259
        if (stop < 0)
 
260
          stop = n;
 
261
        gtk_text_buffer_get_iter_at_offset(buffer, &b, stop);
 
262
        gtk_text_buffer_apply_tag(buffer, help_tag_italic, &a, &b);
 
263
        i = stop;
 
264
        break;
 
265
 
 
266
/* fixed width font */
 
267
      case 'f':
 
268
/* make the tag invisible */
 
269
        gtk_text_buffer_get_iter_at_offset(buffer, &a, i);
 
270
        gtk_text_buffer_get_iter_at_offset(buffer, &b, i+3);
 
271
        gtk_text_buffer_apply_tag(buffer, help_tag_invisible, &a, &b);
 
272
        a = b;
 
273
/* apply the fixed tag to the rest of the line */
 
274
        stop = -1;
 
275
        for (j=i+3 ; j<n ; j++)
 
276
          {
 
277
          if (source[j] == '\n')
 
278
            {
 
279
            stop = j;
 
280
            break;
 
281
            }
 
282
          }
 
283
        if (stop < 0)
 
284
          stop = n;
 
285
        gtk_text_buffer_get_iter_at_offset(buffer, &b, stop);
 
286
        gtk_text_buffer_apply_tag(buffer, help_tag_fixed, &a, &b);
 
287
        i = stop;
 
288
        break;
 
289
 
 
290
/* picture */
 
291
      case 'p':
 
292
/* get the picture label code */
 
293
        stop = -1; 
 
294
        for (j=i+3 ; j<n ; j++)
 
295
          {
 
296
          if (source[j] == ' ' || source[j] == '\n')
 
297
            {
 
298
            stop = j;
 
299
            break;
 
300
            }
 
301
          }
 
302
        if (stop < 0)
 
303
          stop = n;
 
304
 
 
305
/* hide the tag */
 
306
        gtk_text_buffer_get_iter_at_offset(buffer, &a, i);
 
307
        gtk_text_buffer_get_iter_at_offset(buffer, &b, stop);
 
308
        gtk_text_buffer_apply_tag(buffer, help_tag_invisible, &a, &b);
 
309
 
 
310
/* CURRENT - delete one char to compensate? */
 
311
gtk_text_buffer_get_iter_at_offset(buffer, &b, i+1);
 
312
gtk_text_buffer_delete(buffer, &a, &b);
 
313
 
 
314
/* insert the pixbuf - counts as one character in the text buffer */
 
315
        text = g_strndup(&source[i+3], stop-i-3);
 
316
        pixbuf = image_table_lookup(text);
 
317
        gtk_text_buffer_insert_pixbuf(buffer, &a, pixbuf);
 
318
 
 
319
        i = stop;
 
320
        break;
 
321
      }
 
322
    }
 
323
  i++;
 
324
  }
 
325
}
 
326
 
 
327
/***************************/
 
328
/* topic selection handler */
 
329
/***************************/
 
330
void gui_help_topic_selected(GtkTreeSelection *selection, gpointer data)
 
331
{
 
332
gchar *topic, *text;
 
333
GtkTreeIter iter;
 
334
GtkTreeModel *treemodel;
 
335
GtkTextBuffer *buffer;
 
336
 
 
337
/* record selection as the active entry */
 
338
if (gtk_tree_selection_get_selected(selection, &treemodel, &iter))
 
339
  {
 
340
  gtk_tree_model_get(treemodel, &iter, 0, &topic, -1);
 
341
  text = g_hash_table_lookup(sysenv.manual, topic);
 
342
  buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(data));
 
343
  gui_help_topic_show(buffer, text);
 
344
  }
 
345
}
 
346
 
 
347
/*******************************/
 
348
/* topic list sorting primitve */
 
349
/*******************************/
 
350
gint help_sort_topics(GtkTreeModel *treemodel, GtkTreeIter *a, GtkTreeIter *b, gpointer data)
 
351
{
 
352
gchar *str1, *str2;
 
353
 
 
354
gtk_tree_model_get(treemodel, a, 0, &str1, -1);
 
355
gtk_tree_model_get(treemodel, b, 0, &str2, -1);
 
356
 
 
357
return(strcasecmp(str1, str2));
 
358
}
 
359
 
 
360
/****************************/
 
361
/* display a manual browser */
 
362
/****************************/
 
363
void gui_help_dialog(void)
 
364
{
39
365
gpointer dialog;
40
 
GtkWidget *window, *notebook, *hbox, *vbox, *frame, *label;
41
 
GString *buff, *title;
 
366
GtkCellRenderer *r;
 
367
GtkTreeViewColumn *c;
 
368
GtkListStore *list;
 
369
GtkTreeSelection *select;
 
370
GtkWidget *window, *swin, *hbox, *tree, *view;
42
371
 
43
 
/* create a dialog */
44
 
dialog = dialog_request(ABOUT, "About", NULL, NULL, NULL);
 
372
/* create dialog */
 
373
dialog = dialog_request(MANUAL, "Manual", NULL, NULL, NULL);
45
374
if (!dialog)
46
375
  return;
47
376
window = dialog_window(dialog);
48
 
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
49
 
 
50
 
/* notebook display */
51
 
hbox = gtk_hbox_new(FALSE,0);
52
 
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox), hbox, TRUE, TRUE, 10);
53
 
notebook = gtk_notebook_new();
54
 
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP);
55
 
gtk_container_add(GTK_CONTAINER(hbox), notebook);
56
 
 
57
 
/* data strings */
58
 
buff = g_string_new(NULL);
59
 
title = g_string_new(NULL);
60
 
 
61
 
/* fill out the pages in the notebook */
62
 
for (doc=0 ; doc<LAST ; doc++)
63
 
  {
64
 
  switch(doc)
65
 
    {
66
 
    case GDIS:
67
 
      g_string_assign(title,"GDIS");
68
 
      g_string_sprintf(buff,"GDIS version %4.2f.%d\n\n",VERSION,PATCH);
69
 
      g_string_append(buff,"The GTK Display Interface for Structures\n\n");
70
 
      g_string_append(buff,"(c) 2004 by Sean Fleming\n");
71
 
      g_string_append(buff,"sean@power.curtin.edu.au\n\n");
72
 
      g_string_append(buff,"http://gdis.sourceforge.net\n\n");
73
 
      g_string_append(buff,"Additional programming:\n\n");
74
 
      g_string_append(buff,"Andrew Rohl\n");
75
 
      g_string_append(buff,"andrew@power.curtin.edu.au\n\n");
76
 
      g_string_append(buff,"Current development of this project is supported by the\n");
77
 
      g_string_append(buff,"Western Australian Premier's Research Fellowship.\n"); 
78
 
      break;
79
 
    case SGINFO:
80
 
      g_string_assign(title,"SgInfo");
81
 
      g_string_sprintf(buff,"Space Group information lookup.\n\n");
82
 
      g_string_append(buff,"(c) 1994-96 by Ralf W. Grosse-Kunstleve.\n\n");
83
 
      g_string_append(buff,"rwgk@laplace.csb.yale.edu\n\n");
84
 
      break;
85
 
    case SYMMETRY:
86
 
      g_string_assign(title,"Symmetry");
87
 
      g_string_sprintf(buff,"Brute force symmetry analyzer\n\n");
88
 
      g_string_append(buff,"(c) 1996 Sergei Pachkovsky\n\n");
89
 
      g_string_append(buff,"patchkov@chem.ucalgary.ca\n\n");
90
 
      g_string_append(buff,"http://www.cobalt.chem.ucalgary.ca/ps/\n\n");
91
 
      break;
92
 
    case CDD:
93
 
      g_string_assign(title,"CDD");
94
 
      g_string_sprintf(buff,"CDD uses the double description method to compute\n");
95
 
      g_string_append(buff,"the vertices and extreme rays of a polyhedron.\n");
96
 
      g_string_append(buff,"It is utilized in calculating crystal habits.\n\n");
97
 
      g_string_append(buff,"(c) 1997 by Komei Fukuda\n\n");
98
 
      g_string_append(buff,"fukuda@ifor.math.ethz.ch\n\n");
99
 
      g_string_append(buff,"http://www.ifor.math.ethz.ch/~fukuda/cdd_home/cdd.html\n\n");
100
 
      break;
101
 
    case GPERIODIC:
102
 
      g_string_assign(title,"GPeriodic");
103
 
      g_string_sprintf(buff,"Shows the periodic table of elements.\n\n");
104
 
      g_string_append(buff,"(c) 1999 by Kyle R. Burton\n\n");
105
 
      g_string_append(buff,"mortis@voicenet.com\n\n");
106
 
      g_string_append(buff,"http://www.voicenet.com/~mortis\n");
107
 
      g_string_append(buff,"http://gperiodic.seul.org\n\n");
108
 
      g_string_append(buff,"Contributing authors:\n");
109
 
      g_string_append(buff,"a.w.peters@ieee.org,\n");
110
 
      g_string_append(buff,"khazuada@univ-littoral.fr,\n");
111
 
      g_string_append(buff,"mrivera@cable.net.co,\n");
112
 
      g_string_append(buff,"chris@koeln.ccc.de,\n");
113
 
      g_string_append(buff,"lalo@linuxcenter.com.br\n");
114
 
      g_string_append(buff,"koen_kooi@hotmail.com\n\n");
115
 
      break; 
116
 
    case OPENGL:
 
377
gtk_window_set_default_size(GTK_WINDOW(window), 800, 500);
 
378
 
 
379
/* split pane display */
 
380
hbox = gtk_hbox_new(FALSE, 0);
 
381
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(window)->vbox), hbox, TRUE, TRUE, 1);
 
382
 
 
383
/* left pane - topics browser */
 
384
swin = gtk_scrolled_window_new(NULL, NULL);
 
385
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swin),
 
386
                               GTK_POLICY_NEVER, GTK_POLICY_NEVER);
 
387
gtk_box_pack_start(GTK_BOX(hbox), swin, FALSE, TRUE, 0);
 
388
 
 
389
/* list */
 
390
list = gtk_list_store_new(1, G_TYPE_STRING);
 
391
tree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(list));
 
392
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(swin), tree);
 
393
r = gtk_cell_renderer_text_new();
 
394
c = gtk_tree_view_column_new_with_attributes(" ", r, "text", 0, NULL);
 
395
gtk_tree_view_append_column(GTK_TREE_VIEW(tree), c);
 
396
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree), FALSE);
 
397
 
 
398
/* auto sort the topic list */
 
399
gtk_tree_sortable_set_default_sort_func(GTK_TREE_SORTABLE(GTK_TREE_MODEL(list)),
 
400
                                        help_sort_topics, NULL, NULL); 
 
401
gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(GTK_TREE_MODEL(list)),
 
402
                                     GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
 
403
                                     GTK_SORT_ASCENDING);
 
404
 
 
405
/* set the width of the topics pane */
 
406
gtk_widget_set_size_request(swin, 15*sysenv.gtk_fontsize, -1);
 
407
 
 
408
/* right pane - text */
 
409
swin = gtk_scrolled_window_new(NULL, NULL);
 
410
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(swin),
 
411
                               GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
 
412
gtk_box_pack_start(GTK_BOX(hbox), swin, TRUE, TRUE, 0);
 
413
view = gtk_text_view_new();
 
414
gtk_text_view_set_editable(GTK_TEXT_VIEW(view), FALSE);
 
415
gtk_container_add(GTK_CONTAINER(swin), view);
 
416
 
 
417
/* configure the text viewing area */
 
418
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(view), GTK_WRAP_WORD);
 
419
/* NB: GTK_JUSTIFY_FILL was not supported at the time this was written */
 
420
/*
 
421
gtk_text_view_set_justification(GTK_TEXT_VIEW(view), GTK_JUSTIFY_FILL);
 
422
*/
 
423
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(view), PANEL_SPACING);
 
424
gtk_text_view_set_right_margin(GTK_TEXT_VIEW(view), PANEL_SPACING);
 
425
 
 
426
/* NB: these are associated with the text buffer and must be reallocated each */
 
427
/* time a new text buffer is created */
 
428
help_tag_bold=NULL;
 
429
help_tag_italic=NULL;
 
430
help_tag_invisible=NULL;
 
431
help_tag_fixed=NULL;
 
432
 
 
433
/* topic selection handler */
 
434
select = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree));
 
435
gtk_tree_selection_set_mode(select, GTK_SELECTION_SINGLE);
 
436
g_signal_connect(G_OBJECT(select), "changed",
 
437
                 G_CALLBACK(gui_help_topic_selected),
 
438
                 view);
 
439
 
 
440
/* terminating button */
 
441
gui_stock_button(GTK_STOCK_CLOSE, dialog_destroy, dialog,
 
442
                   GTK_DIALOG(window)->action_area);
 
443
 
 
444
/* populate the manual page */
 
445
gui_help_refresh(list);
 
446
 
 
447
/* expose the dialog */
 
448
gtk_widget_show_all(window);
 
449
}
 
450
 
 
451
/***************/
 
452
/* help dialog */
 
453
/***************/
 
454
/*
117
455
      g_string_assign(title,"OpenGL");
118
456
      g_string_sprintf(buff,"GL_RENDERER    %s\n", glGetString(GL_RENDERER));
119
457
      g_string_sprintfa(buff,"GL_VERSION       %s\n", glGetString(GL_VERSION));
120
458
      g_string_sprintfa(buff,"GL_VENDOR        %s\n", glGetString(GL_VENDOR));
121
 
      break;
122
 
    case POVRAY:
123
 
      g_string_assign(title,"POVRay");
124
 
      g_string_sprintf(buff,"The Persistence Of Vision Raytracer\n\n");
125
 
      g_string_append(buff,"http://www.povray.org\n\n");
126
 
      g_string_append(buff,"GDIS acts only as a GUI to POVRay.\n\n");
127
 
      g_string_append(buff,"A working version of POVRay must be installed\n");
128
 
      g_string_append(buff,"on your system in order to render molecules.\n");
129
 
      break;
130
 
    case GULP:
131
 
      g_string_assign(title,"GULP");
132
 
      g_string_sprintf(buff,"The General Utility Lattice Program\n\n");
133
 
      g_string_append(buff,"(c) Julian Gale\n\n");
134
 
      g_string_append(buff,"j.gale@curtin.edu.au\n\n");
135
 
      g_string_append(buff,"http://gulp.curtin.edu.au/\n\n");
136
 
      g_string_append(buff,"GDIS acts only as a GUI to GULP.\n\n");
137
 
      g_string_append(buff,"A working version of GULP must be installed on\n");
138
 
      g_string_append(buff,"your system in order to run energy calculations.\n");
139
 
      break; 
140
 
    case BABEL:
141
 
      g_string_assign(title,"Babel");
142
 
      g_string_sprintf(buff,"A coordinate file interconversion program\n\n");
143
 
      g_string_append(buff,"(c) 1992-1996 Pat Walters and Matt Stahl\n\n");
144
 
      g_string_append(buff,"babel@mercury.aichem.arizona.edu\n\n");
145
 
      g_string_append(buff,"http://smog.com/chem/babel/\n\n");
146
 
      g_string_append(buff,"GDIS acts only as a GUI to Babel.\n\n");
147
 
      g_string_append(buff,"A working version of Babel must be installed on\n");
148
 
      g_string_append(buff,"your system in order to load certain filetypes.\n");
149
 
      break;
150
 
/* empty page */
151
 
    default:
152
 
      continue;
153
 
    }
154
 
/* frame each page */
155
 
  frame = gtk_frame_new (title->str);
156
 
  gtk_container_set_border_width (GTK_CONTAINER (frame), 10);
157
 
/* put in a vbox to get a border around the text */
158
 
  vbox = gtk_vbox_new(TRUE,0);
159
 
  gtk_container_add (GTK_CONTAINER (frame), vbox);
160
 
  gtk_container_set_border_width (GTK_CONTAINER(GTK_BOX(vbox)), 10);
161
 
/* add the title & text */
162
 
  label = gtk_label_new (buff->str);
163
 
  gtk_container_add(GTK_CONTAINER(GTK_BOX(vbox)), label);
164
 
  label = gtk_label_new (title->str);
165
 
  gtk_notebook_append_page (GTK_NOTEBOOK (notebook), frame, label);
166
 
  }
167
 
 
168
 
/* starting page - GDIS, of course */
169
 
gtk_notebook_set_page(GTK_NOTEBOOK(notebook), 0);
170
 
 
171
 
/* terminating button */
172
 
gtksh_stock_button(GTK_STOCK_CLOSE, dialog_destroy, dialog,
173
 
                   GTK_DIALOG(window)->action_area);
174
 
 
175
 
 
176
 
/* show the dialog */
177
 
gtk_widget_show_all(window);
178
 
 
179
 
/* done */
180
 
g_string_free(buff, TRUE);
181
 
g_string_free(title, TRUE);
182
 
}
183
 
 
 
459
*/