summaryrefslogtreecommitdiff
path: root/src/Fl_Menu_.cxx
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>1999-05-06 06:20:47 +0000
committerBill Spitzak <spitzak@gmail.com>1999-05-06 06:20:47 +0000
commitc025851f8327bf8856f9e121571dd1647f68fb7f (patch)
tree9039b5d0d9207cf5a279af3bbb1434dc5199ae5c /src/Fl_Menu_.cxx
parent72a313292c0b0783a7fc92544d4fa805d613d3a6 (diff)
Fixed another flwm crash in Fl_x.cxx (the send_motion pointer must
be ignored if the fl_xmousewin is deleted). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@577 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Menu_.cxx')
-rw-r--r--src/Fl_Menu_.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/Fl_Menu_.cxx b/src/Fl_Menu_.cxx
index 18ddebecf..4f5da0575 100644
--- a/src/Fl_Menu_.cxx
+++ b/src/Fl_Menu_.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Menu_.cxx,v 1.7.2.4 1999/05/06 01:17:49 carl Exp $"
+// "$Id: Fl_Menu_.cxx,v 1.7.2.5 1999/05/06 06:20:46 bill Exp $"
//
// Common menu code for the Fast Light Tool Kit (FLTK).
//
@@ -112,7 +112,9 @@ void Fl_Menu_::menu(const Fl_Menu_Item* m) {
value_ = menu_ = (Fl_Menu_Item*)m;
}
-/* This version is broken
+#if 1
+// this version is ok with new Fl_Menu_add code with fl_menu_array_owner:
+
void Fl_Menu_::copy(const Fl_Menu_Item* m, void* user_data) {
int n = m->size();
Fl_Menu_Item* newMenu = new Fl_Menu_Item[n];
@@ -125,9 +127,11 @@ void Fl_Menu_::copy(const Fl_Menu_Item* m, void* user_data) {
newMenu++;
}
}
-*/
-// This is Guillaume Nodet's fixed version
+#else
+// This is Guillaume Nodet's fixed version for the older Fl_Menu_add
+// that enlarged the array at powers of 2:
+
void Fl_Menu_::copy(const Fl_Menu_Item* m, void* user_data) {
int i, s = m->size(), n=s;
for (i=0; n; n>>=1, i++);
@@ -143,6 +147,7 @@ void Fl_Menu_::copy(const Fl_Menu_Item* m, void* user_data) {
newMenu++;
}
}
+#endif
Fl_Menu_::~Fl_Menu_() {
clear();
@@ -167,5 +172,5 @@ void Fl_Menu_::clear() {
}
//
-// End of "$Id: Fl_Menu_.cxx,v 1.7.2.4 1999/05/06 01:17:49 carl Exp $".
+// End of "$Id: Fl_Menu_.cxx,v 1.7.2.5 1999/05/06 06:20:46 bill Exp $".
//