diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-10-15 14:19:34 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-10-15 14:19:34 +0000 |
| commit | 255e7fb39b83523c52855809bb9a80f647fe4cff (patch) | |
| tree | 6f5b4eff04b13405b94cacecafd1ed449860f661 /fluid/Fl_Function_Type.cxx | |
| parent | 45bb73a9bf4692c68294be12a2e25a39ca3a307b (diff) | |
Fluid fixes from Vincent PENNE.
git-svn-id: file:///fltk/svn/fltk/trunk@12 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/Fl_Function_Type.cxx')
| -rw-r--r-- | fluid/Fl_Function_Type.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index 21bdb5b37..32926e1ca 100644 --- a/fluid/Fl_Function_Type.cxx +++ b/fluid/Fl_Function_Type.cxx @@ -66,6 +66,8 @@ const char *c_check(const char *c, int type) { class Fl_Function_Type : public Fl_Type { const char* return_type; + const char* actual_return_type; + const char* star; char public_, constructor, havewidgets; public: Fl_Type *make(); @@ -166,21 +168,21 @@ void Fl_Function_Type::write_code1() { Fl_Type *child; const char* widget_type = 0; for (child = next; child && child->level > level; child = child->next) - if (child->is_widget()) { + if (child->is_widget() && child->level == level+1) { havewidgets = 1; widget_type = subclassname(child); - break; } write_c("\n"); if (ismain()) write_c("int main(int argc, char **argv) {\n"); else { const char* t = return_type; - const char* star = ""; + star = ""; if (!t) { if (havewidgets) {t = widget_type; star = "*";} else t = "void"; } + actual_return_type=t; const char* k = class_name(); if (k) { write_public(public_); @@ -200,7 +202,7 @@ void Fl_Function_Type::write_code1() { write_c("%s%s %s {\n", t, star, name()); } } - if (havewidgets) write_c(" %s* w;\n", widget_type); + if (havewidgets) write_c(" Fl_Window* w;\n"); indentation += 2; } @@ -209,7 +211,7 @@ void Fl_Function_Type::write_code2() { if (havewidgets) write_c(" w->show(argc, argv);\n"); write_c(" return Fl::run();\n"); } else if (havewidgets && !constructor) - write_c(" return w;\n"); + write_c(" return (%s%s)w;\n", actual_return_type, star); write_c("}\n"); indentation = 0; } |
