Fix STR #2596: Fluid generated improper callback member functions for

Fl_Menu_Item's in widget classes. Fixed with OP's patch.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8622 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy
2011-04-24 16:25:09 +00:00
parent 06e17886ed
commit 89be9d5e04
+7 -3
View File
@@ -211,10 +211,14 @@ void Fl_Menu_Item_Type::write_static() {
write_c("\n}\n");
if (k) {
write_c("void %s::%s(Fl_Menu_* o, %s v) {\n", k, cn, ut);
write_c(" ((%s*)(o->", k);
write_c(" ((%s*)(o", k);
Fl_Type* t = parent; while (t->is_menu_item()) t = t->parent;
for (t = t->parent; t && t->is_widget() && !is_class(); t = t->parent) write_c("parent()->");
write_c("user_data()))->%s_i(o,v);\n}\n", cn);
Fl_Type *q = 0;
for (t = t->parent; t && t->is_widget() && !is_class(); q = t, t = t->parent)
write_c("->parent()");
if (!q || strcmp(q->type_name(), "widget_class"))
write_c("->user_data()");
write_c("))->%s_i(o,v);\n}\n", cn);
}
}
if (image) {