Use the move-curser signal instead of deleted-mark et. al.
authorJoachim Breitner <mail@joachim-breitner.de>
Mon, 20 Jul 2009 21:36:07 +0000 (21:36 +0000)
committerJoachim Breitner <mail@joachim-breitner.de>
Mon, 20 Jul 2009 21:36:07 +0000 (21:36 +0000)
This properly avoids showing the entry field if data is given on the command
line.

sm.c

diff --git a/sm.c b/sm.c
index e8ca228..92c22e9 100644 (file)
--- a/sm.c
+++ b/sm.c
@@ -174,11 +174,7 @@ static void newtext() {
        hq(FALSE, TRUE);
 }
 
        hq(FALSE, TRUE);
 }
 
-static void mark_deleted(GtkTextBuffer* tb, GtkTextMark* m, gpointer d){
-       show_entry();
-}
-
-static void mark_set(GtkTextBuffer* tb, GtkTextIter* l, GtkTextMark* m, gpointer d){
+static void move_cursor(GtkTextView* tv, GtkMovementStep step, gint count, gboolean extend_selection, gpointer user_data) {
        show_entry();
 }
 
        show_entry();
 }
 
@@ -364,8 +360,7 @@ int main(int argc, char **argv) {
 
        g_signal_connect_after(G_OBJECT(draw), "expose-event", G_CALLBACK(redraw), NULL);
        g_signal_connect(G_OBJECT(tb), "changed", G_CALLBACK(newtext), NULL);
 
        g_signal_connect_after(G_OBJECT(draw), "expose-event", G_CALLBACK(redraw), NULL);
        g_signal_connect(G_OBJECT(tb), "changed", G_CALLBACK(newtext), NULL);
-       g_signal_connect(G_OBJECT(tb), "mark-set", G_CALLBACK(mark_set), NULL);
-       g_signal_connect(G_OBJECT(tb), "mark-deleted", G_CALLBACK(mark_deleted), NULL);
+       g_signal_connect(G_OBJECT(tv), "move-cursor", G_CALLBACK(move_cursor), NULL);
 
        if (!input_provided)
                show_entry();
 
        if (!input_provided)
                show_entry();