summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-04-24 16:25:09 +0000
committerManolo Gouy <Manolo>2011-04-24 16:25:09 +0000
commit89be9d5e04497817a62ac5060abd688bfd173413 (patch)
tree6174c021473ab92caa12758b82b24e9767670ca9
parent06e17886eda63d462b5a68b5b72e93b172b492ac (diff)
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
-rw-r--r--fluid/Fl_Menu_Type.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/fluid/Fl_Menu_Type.cxx b/fluid/Fl_Menu_Type.cxx
index d63e15962..2bca9c59f 100644
--- a/fluid/Fl_Menu_Type.cxx
+++ b/fluid/Fl_Menu_Type.cxx
@@ -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) {