It seems that should be a case when the parent is stored on user_data ? popup mneu ?

I tested with old fluid versions and all generate the same code, that doesn't work for my application.
Modifying the code like this generates code that works:

-----------

if (k) {
write_c("void %s::%s(Fl_Menu_* o, %s v) {\n", k, cn, ut);
write_c(" ((%s*)(o->", k);
Fl_Type* t = parent; while (t->is_menu_item()) t = t->parent;
for (t = t->parent; t && t->parent && t->is_widget() && !is_class(); t = t->parent) write_c("parent()->");
write_c("parent()))->%s_i(o,v);\n}\n", cn);
}
}

-----------

En 08/11/2010 00:09:01, Domingo Alvarez Duarte <[email protected]> escribió:

> Not so fast !
> Apparently I found a sleeping bug trying to solve this problem:
>
> Fl_Menu_Type.cxx around line 212
> -------
> if (k) {
> write_c("void %s::%s(Fl_Menu_* o, %s v) {\n", k, cn, ut);
> 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);
> }
> -------
>
> It's generating a fault code:
> ((Sqlite3cc_Window*)(o->parent()->user_data()))->cb_menu_file_open_i(o,v);
> <=== fault code that crash app
>
> Code updated by hand that whoerks (cutting the "->user_data()" that most
> of the time is NULL):
>
> ((Sqlite3cc_Window*)(o->parent()))->cb_menu_file_open_i(o,v);
>
>
> En 07/11/2010 19:57:39, Matthias Melcher <[email protected]> escribió:
>
>>
>> On 07.11.2010, at 19:28, Domingo Alvarez Duarte wrote:
>>
>>> Thanks for showing me it, I applied it to my copy and it is working
>>> now.
>>> I don't know why it's not yet applied to the repository.
>>>
>>> I vote for it's inclusion !
>>
>> The reason is simple: nobody had time yet to look at it and verify it.
>> I checked parts of it and found it ok, but the more votes I get the
>> better. I want to avoid introducing problems, and the given patch is
>> quite large.
>>
>> So I guess I can apply it now?
>>
>> - Matthias
>
>


--
Usando el revolucionario cliente de correo de Opera: http://www.opera.com/mail/
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to