SegFault with gtk_widget_show and gtk_widget_hide



Hi guys,

I tried to show or hide some gtk_widget depending on a certain condtion.
I put in a callback function things like:

    sichtbar[k][i] ? gtk_widget_show((GtkWidget *)lbl_frequenz) : gtk_widget_hide((GtkWidget *)lbl_frequenz); 
i++;
    sichtbar[k][i] ? gtk_widget_show((GtkWidget *)lbl_amplitude) : gtk_widget_hide((GtkWidget 
*)lbl_amplitude); i++;
    sichtbar[k][i] ? gtk_widget_show((GtkWidget *)lbl_offset) : gtk_widget_hide((GtkWidget *)lbl_offset); i++;
    sichtbar[k][i] ? gtk_widget_show((GtkWidget *)lbl_einzeit) : gtk_widget_hide((GtkWidget *)lbl_einzeit); 
i++;
    sichtbar[k][i] ? gtk_widget_show((GtkWidget *)lbl_risetime) : gtk_widget_hide((GtkWidget *)lbl_risetime); 
i++;
    sichtbar[k][i] ? gtk_widget_show((GtkWidget *)lbl_falltime) : gtk_widget_hide((GtkWidget *)lbl_falltime); 
i++;
    sichtbar[k][i] ? gtk_widget_show((GtkWidget *)lbl_triggermodus) : gtk_widget_hide((GtkWidget 
*)lbl_triggermodus); i++;
    sichtbar[k][i] ? gtk_widget_show((GtkWidget *)lbl_polaritaet) : gtk_widget_hide((GtkWidget 
*)lbl_polaritaet); i++;
    sichtbar[k][i] ? gtk_widget_show((GtkWidget *)lbl_triggerampli) : gtk_widget_hide((GtkWidget 
*)lbl_triggerampli); i++;
    sichtbar[k][i] ? gtk_widget_show((GtkWidget *)lbl_triggerdelay) : gtk_widget_hide((GtkWidget 
*)lbl_triggerdelay); i++;
    sichtbar[k][i] ? gtk_widget_show((GtkWidget *)lbl_patternlaenge) : gtk_widget_hide((GtkWidget 
*)lbl_patternlaenge); i++;
    sichtbar[k][i] ? gtk_widget_show((GtkWidget *)lbl_patternrepeat) : gtk_widget_hide((GtkWidget 
*)lbl_patternrepeat); i++;
    sichtbar[k][i] ? gtk_widget_show((GtkWidget *)lbl_patternzeit) : gtk_widget_hide((GtkWidget 
*)lbl_patternzeit); i++;

But some of that are leading to a segmentation fault. 
Version ist gtk+ 3.0. sichtbar[k][i] is an array with 0 or 1 in it.
lbl_xxx is implemented like:    lbl_frequenz =      GTK_LABEL (gtk_builder_get_object (builder, 
"label_frequenz"));

Does anybody know what is wrong?

Cheers,
Axel


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]