summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-11-06 12:21:42 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2008-11-06 12:21:42 +0000
commit61e5d29d2717ab2bae85fd12e621b35e6463446e (patch)
treef6ef2b09a5026a0d6ddfc16dbac0e6fa6ed73fda
parent1f5d97ec6a8fcc770ee8b80b21b7a852b55567cd (diff)
Menu option to disable syntax highlighting.
-rw-r--r--src/main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 25e6dc3..64879ce 100644
--- a/src/main.c
+++ b/src/main.c
@@ -448,6 +448,13 @@ numbers_toggled_cb (GtkToggleAction *action, sphinx_t *sphinx)
}
static void
+syntax_toggled_cb (GtkToggleAction *action, sphinx_t *sphinx)
+{
+ gtk_source_buffer_set_highlight_syntax (sphinx->buffer,
+ gtk_toggle_action_get_active (action));
+}
+
+static void
break_surface_cb (GtkToggleAction *action, sphinx_t *sphinx)
{
sphinx->break_on_surface_undef = gtk_toggle_action_get_active (action);
@@ -797,6 +804,7 @@ sphinx_new (void)
" </menu>"
" <menu action='ViewMenu'>"
" <menuitem action='ViewNumbers'/>"
+ " <menuitem action='ViewSyntax'/>"
" <menuitem action='ViewStyleMenu'/>"
" </menu>"
" <menu action='DebugMenu'>"
@@ -812,7 +820,7 @@ sphinx_new (void)
" </menu>"
" </menubar>"
"</ui>";
- GtkActionEntry action_entries[] = {
+ const GtkActionEntry action_entries[] = {
{ "FileMenu", NULL, "_File" },
{ "Open", GTK_STOCK_OPEN, "_Open", "<control>O",
"Open a new trace", G_CALLBACK (open_trace_dlg) },
@@ -843,9 +851,11 @@ sphinx_new (void)
{ "Reset", NULL, "_Reset", NULL,
"", G_CALLBACK (reset_interpreter_cb) },
};
- GtkToggleActionEntry toggle_entries[] = {
+ const GtkToggleActionEntry toggle_entries[] = {
{ "ViewNumbers", NULL, "Show line _numbers", NULL,
"", G_CALLBACK (numbers_toggled_cb), TRUE },
+ { "ViewSyntax", NULL, "Show syntax _highlighting", NULL,
+ "", G_CALLBACK (syntax_toggled_cb), TRUE },
{ "BreakSurface", NULL, "Break after Surface undef", NULL,
"", G_CALLBACK (break_surface_cb), FALSE},
{ "BreakContext", NULL, "Break after Context undef", NULL,