Page 1 of 1

Dynamically altering menus created in form designer

Posted: Mon Jan 08, 2024 3:17 am
by dougmo52usr
1. If I add a menu to a window in form designer, then run the app, clicking on the menu title causes the title to highlight and the menu drops down as expected. Is there a way to be notified before the menu drops down so I can dynamically edit it?

2. If I click on a submenu, it highlights and the submenu drops down. Is there a way I can be notified before the submenu drops so I can dynamically edit it?

3. When I use CreatePopupMenu and DisplayPopupMenu, the popup works fine, but the errorlog shows an error when the popup
is displayed, and when an item is selected. When debugging, it occasionally covers my app main window with the editor source, and typically highlights the Event = WaitWindowEvent() call. I currently process the events for the popup in an event handler attached by BindMenuEvent. The handler is called and the menu items seem correct. It's like a WindowEvent is sent for the menuitem after the bound handler processed it and deleted the object.

[21:05:09] [WARNING] m480Ctrl.pb (Line: 188)
[21:05:09] [WARNING] GLib-GObject (CRITICAL): g_object_get_data: assertion 'G_IS_OBJECT (object)' failed
[21:05:15] [WARNING] m480Ctrl.pb (Line: 382)
[21:05:15] [WARNING] GLib-GObject (CRITICAL): g_object_get_data: assertion 'G_IS_OBJECT (object)' failed