File: help.c

package info (click to toggle)
denemo 0.5.9-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,500 kB
  • ctags: 2,415
  • sloc: ansic: 23,057; sh: 3,321; yacc: 1,737; makefile: 449; lex: 376
file content (49 lines) | stat: -rw-r--r-- 1,764 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* help.c
 * implements the stuff under Help in the menubar
 *
 * for Denemo, a gtk+ frontend to GNU Lilypond
 * (c) 2000, 2001 Matthew Hiller
 */

#include "datastructures.h"
#include "config.h"

/* The tutorial mentioned that the actual gchar * held within a
 * GtkText widget needs to be freed.  I don't do such a free, though,
 * so I think this function has a memory leak in it. */

void
about (gpointer callback_data, guint callback_action, GtkWidget * widget)
{
  GtkWidget *dialog, *hbox, *text, *vscrollbar;
  static gchar *about_text;

  about_text = g_strconcat
    (_("Denemo, the GNU graphical score editor\n\nVersion "),
     VERSION, "\n\n",
     _("(c) 1999, 2000, 2001 Matthew Hiller, Adam Tee, and others.\n\n\
http://www.gnu.org/software/denemo/denemo.html\n\n\
This program is licensed under the terms of the GNU\n\
General Public License and is provided with absolutely\n\
NO WARRANTY; see the file COPYING for details."), NULL);

  dialog = gtk_window_new (GTK_WINDOW_DIALOG);
  gtk_window_set_title (GTK_WINDOW (dialog), _("About Denemo"));
  gtk_window_set_default_size (GTK_WINDOW (dialog), 500, 200);
  hbox = gtk_hbox_new (FALSE, 0);
  text = gtk_text_new (NULL, NULL);
  gtk_text_set_editable (GTK_TEXT (text), FALSE);
  gtk_text_set_word_wrap (GTK_TEXT (text), TRUE);
  vscrollbar = gtk_vscrollbar_new (GTK_TEXT (text)->vadj);
  gtk_box_pack_end (GTK_BOX (hbox), vscrollbar, FALSE, FALSE, 0);
  gtk_widget_show (vscrollbar);

  gtk_text_set_point (GTK_TEXT (text), 0);
  gtk_text_insert (GTK_TEXT (text), NULL, NULL, NULL, about_text, -1);
  gtk_box_pack_start (GTK_BOX (hbox), text, TRUE, TRUE, 0);
  gtk_widget_show (text);

  gtk_container_add (GTK_CONTAINER (dialog), hbox);
  gtk_widget_show (hbox);
  gtk_widget_show (dialog);
}