aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona2013-03-27 14:01:05 +0100
committerJoakim Verona2013-03-27 14:01:05 +0100
commit17e7bda9299973f29044658aab72dac59efba064 (patch)
treef16476bc81a2dce34c08bf53f998f09b25a5bace /src
parent10f659bef0c1df7582b26c9f8b38680771077042 (diff)
downloademacs-17e7bda9299973f29044658aab72dac59efba064.tar.gz
emacs-17e7bda9299973f29044658aab72dac59efba064.zip
make xwgir less crash prone when flawed args
Diffstat (limited to 'src')
-rw-r--r--src/xwidget.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/xwidget.c b/src/xwidget.c
index 22993df3a91..caf6aa9aae5 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -901,7 +901,13 @@ xwidget_init_view (struct xwidget *xww,
901#endif 901#endif
902 902
903 903
904 } else { 904 } else //xwgir sanity checks:
905 if(Fget(xww->type, Qcxwgir_class) == Qnil){
906 printf("error, Fget(xww->type, Qcxwgir_class) was nil\n");
907 //we cant just return null here, because drawing will crash later.
908 //currently just display an error component, and stop furher xwgir handling
909 xv->widget = gtk_button_new_with_label ("xwgir failed");
910 } else {
905 //here we have run out of hard coded symbols, we will now attempt to create 911 //here we have run out of hard coded symbols, we will now attempt to create
906 //a widget dynamically 912 //a widget dynamically
907 //TODO 913 //TODO
@@ -909,7 +915,11 @@ xwidget_init_view (struct xwidget *xww,
909 // - support constructor args 915 // - support constructor args
910 // - support signals 916 // - support signals
911 // - check that the argument widget type actually exists 917 // - check that the argument widget type actually exists
912 printf("xwgir symbol %s %s %s:\n",SDATA(SYMBOL_NAME(xww->type)), SDATA(Fcar(Fcdr(Fget(xww->type, Qcxwgir_class)))), SDATA(Fcar(Fget(xww->type, Qcxwgir_class)))); 918
919 printf("xwgir symbol %s %s %s:\n",
920 SDATA(SYMBOL_NAME(xww->type)),
921 SDATA(Fcar(Fcdr(Fget(xww->type, Qcxwgir_class)))),
922 SDATA(Fcar(Fget(xww->type, Qcxwgir_class))));
913 //xv->widget = xwgir_create ("Button"); 923 //xv->widget = xwgir_create ("Button");
914 Fcar(Fget(xww->type, Qcxwgir_class)); 924 Fcar(Fget(xww->type, Qcxwgir_class));
915 xv->widget = xwgir_create( SDATA(Fcar(Fcdr(Fget(xww->type, Qcxwgir_class)))), 925 xv->widget = xwgir_create( SDATA(Fcar(Fcdr(Fget(xww->type, Qcxwgir_class)))),