ºìÁªLinuxÃÅ»§
Linux°ïÖú

½èÈËÆø¼±ÎʹØÓÚgladeµÄÒ»¸öÎÊÌ⣬ϣÍû´ó¼Ò°ïæ½â¾ö

·¢²¼Ê±¼ä:2007-10-02 18:41:29À´Ô´:ºìÁª×÷Õß:zjmdp
ÎÒÏëʵÏÖ°´Ò»¸ö°´Å¥£¬È»ºóÔÚ±êÇ©ÉÏÏÔʾhello×ÖÑù£¬ÎÒÔÚcallbacks.cÖеÄbutton1_clickedʼþÖÐÌí¼ÓÁËgtk_label_set_text(GTK_LABEL(label1)£¬"hello");,±àÒëµÄʱºòÌáʾûÓж¨Òålabel1,ÎÊÌâÒ»£ºÊDz»ÊÇÎÒ»¹ÐèÒªÔÚcallbacks.cÎļþµÄÇ°ÃæÊäÈëGtkWidget *label1;×÷ΪÉùÃ÷£¿
ÎÒÌí¼Ó¸ÃÉùÃ÷ºó±àÒë¿ÉÒÔͨ¹ý£¬µ«ÊÇÔËÐеÄʱºòÎÒµã»÷button1°´Å¥ºó£¬¾Í»áÌáʾGtk warning:invalid cast from Null pointer to "GtkLable"ºÍGtk CRITICAL file GTKlabel.c:line 261(gtk_label_set_text):assertion 'GTK_IS_LABEL(label) 'failed£¬Ê¼ÖÕÎÞ·¨ÊµÏÖ±êÇ©ÏÔʾhello×ÖÑù£¬ÓÉÓÚÕâÊǸö×÷Òµ£¬¿¨ÔÚÕâÀïһֱͨ²»¹ý£¬Ï£Íû´ó¼Ò°ï°ïæ
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 1 ÌõÆÀÂÛ

  1. pretty0229 ÓÚ 2012-11-10 13:45:24·¢±í:

    GtkWidget *label1;³ýÁ˼ÓÕâ¾ä»°ºó»¹Òª¸øËû·ÖÅã¿Õ¼ä°¡£¬£¡£¡
    label1=gtk_lable_new();