aboutsummaryrefslogtreecommitdiff
path: root/src/narrative_window.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2016-04-22 22:43:54 +0200
committerThomas White <taw@bitwiz.org.uk>2016-04-22 22:45:03 +0200
commitbf21da066c16bd945f56230f726bc95e70f41bc2 (patch)
treed5f36ffa6c9d1175a6dbe4aeab6b22fd0db405b5 /src/narrative_window.c
parent044b25bb359c4b3254b947ca34a1491f5eb9f901 (diff)
Slide adding works
Diffstat (limited to 'src/narrative_window.c')
-rw-r--r--src/narrative_window.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/narrative_window.c b/src/narrative_window.c
index bfad8b2..5a352f7 100644
--- a/src/narrative_window.c
+++ b/src/narrative_window.c
@@ -154,22 +154,21 @@ static void delete_frame_sig(GSimpleAction *action, GVariant *parameter,
static void add_slide_sig(GSimpleAction *action, GVariant *parameter,
gpointer vp)
{
- int n_slides;
- SCBlock *block;
SCBlock *nsblock;
NarrativeWindow *nw = vp;
- /* Create the SCBlock for the new slide */
- nsblock = sc_parse("\\slide{}");
-
/* Split the current paragraph */
- split_paragraph_at_cursor(nw->sceditor);
+ nsblock = split_paragraph_at_cursor(nw->sceditor);
/* Link the new SCBlock in */
+ if ( nsblock != NULL ) {
+ sc_block_append(nsblock, "slide", NULL, NULL, NULL);
+ } else {
+ fprintf(stderr, "Failed to split paragraph\n");
+ }
- /* Create a new paragraph for the slide */
-
- sc_editor_redraw(nw->sceditor);
+ sc_editor_set_scblock(nw->sceditor,
+ sc_editor_get_scblock(nw->sceditor));
}