|
|
Ah, sorry about that. As for populating the array, I sort of copied an example from the docs:
{"&alpha", FL_ALT+'a', the_cb, (void*)1}, {"&beta", FL_ALT+'b', the_cb, (void*)2}, {"&strange", 0, strange_cb}, {"&charm", 0, charm_cb}, {"&truth", 0, truth_cb}, {"b&eauty", 0, beauty_cb}, {"one"}, {"two"}, {"three"}, {0}, {0}}; it's essentially a combination of the 1st (&alpha) and 8th (sub&menu) one. It seems to be working after adding the last blank item
On Saturday, May 7, 2022 at 8:21:32 AM UTC-7 lifeatt...@gmail.com wrote:
This is the simpliest menu declaration I would use:
Fl_Menu_Item menu_item[] = { {"name", 0, nullptr, (void*)(int_ptr)}, {0} };
The o->copy code is looking for the zero-filled item as a terminator.
Thanks a lot, I have a bit of an issue though...Here is my code (roughly, my memory isn't perfect):
Fl_Menu_Item menu_item[] = { {"name", 0, nullptr, int_ptr } }; // here int_ptr is a int* which exists for the entire duration of the program Fl_Menu_Button* o = new Fl_Menu_Button(400, 30, 40, 15); o->copy(menu_item); // < here, it crashes and complains about menu_item.size()
Do you know what this might be caused by, and how it could be fixed?
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/12795abc-7928-4679-952c-e4b343346042n%40googlegroups.com.
[ Direct Link to Message ] | |
|
| |