Set properia via gtk_widget_set_can_
authorJoachim Breitner <mail@joachim-breitner.de>
Mon, 17 May 2010 16:01:12 +0000 (16:01 +0000)
committerJoachim Breitner <mail@joachim-breitner.de>
Mon, 17 May 2010 16:01:12 +0000 (16:01 +0000)
This prevents a segfault. But why?

sm.c

diff --git a/sm.c b/sm.c
index c10398d..88df23d 100644 (file)
--- a/sm.c
+++ b/sm.c
@@ -282,7 +282,7 @@ int main(int argc, char **argv) {
        gtk_widget_modify_fg(draw, GTK_STATE_NORMAL, &black);
        g_signal_connect(G_OBJECT(draw), "button-press-event", G_CALLBACK(text_clicked), NULL);
        g_signal_connect(G_OBJECT(draw), "key-press-event", G_CALLBACK(text_keypress), NULL);
-       g_object_set(draw,"can-focus",1);
+       gtk_widget_set_can_focus(draw, TRUE);
 
        GdkPixmap *pixmap = gdk_pixmap_new(NULL, 1, 1, 1);
        GdkColor color;