> If you plan to do any changes in the 1.3.0 source code, please contact me
> first.
>
> Thank you, and lets keep our fingers crossed that we don't get any major bugs
> in!
Hi, I'm sorry for bad news - yesterday I had found one more bug. After
my fast glance at new RC5 I see this bug has remained.
I don't know how about level of the bug, please judge about it yourself.
The method Fl_Menu_::remove() doesn't remove last item in menu. Of
course, you can't clear all menu through that method.
See here: Fl_Menu_Add.cxx:484
const Fl_Menu_Item* next_item = item->next();
Note for the latest menu item the method next() will return the same
item! See further lines:
if (alloc > 1) {
for (Fl_Menu_Item* m = item; m < next_item; m++)
if (m->text) free((void*)(m->text));
}
memmove(item, next_item, (menu_+n-next_item)*sizeof(Fl_Menu_Item));
Thus, neither cycle "for()", nor "memmove()" do nothing because item
== next_item!
You can change menubar.cxx from RC5 in such way
-- mb.remove(1); // delete the "File" submenu
++ int last = mb.size()-1;
++ mb.remove(last);
++ int new_last = mb.size()-1;
after executing "new_last == last" :(
Nikita Egorov
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk