diff options
Diffstat (limited to 'fluid/Fl_Function_Type.cxx')
| -rw-r--r-- | fluid/Fl_Function_Type.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index 5167657e5..6638c235d 100644 --- a/fluid/Fl_Function_Type.cxx +++ b/fluid/Fl_Function_Type.cxx @@ -334,7 +334,8 @@ void Fl_Function_Type::write_code1() { write_c("%s%s %s {\n", rtype, star, s); } } -// if (havewidgets) write_c(" %s* w;\n",subclassname(child)); + + if (havewidgets && !child->name()) write_c(" %s* w;\n", subclassname(child)); indentation += 2; } @@ -342,8 +343,14 @@ void Fl_Function_Type::write_code2() { if (ismain()) { if (havewidgets) write_c(" w->show(argc, argv);\n"); write_c(" return Fl::run();\n"); - } else if (havewidgets && !constructor && !return_type) - write_c(" return w;\n"); + } else if (havewidgets && !constructor && !return_type) { + Fl_Type *child; + const char *var = "w"; + for (child = next; child && child->level > level; child = child->next) + if (child->is_window() && child->name()) var = child->name(); + + write_c(" return %s;\n", var); + } write_c("}\n"); indentation = 0; } |
