I inserted DebugLog statements in main.cpp right before event.Skip() in each handler (e.g., OnEditMenuUpdateUI, OnViewMenuUpdateUI, OnSearchMenuUpdateUI). Then, built and ran CB. There appears to be an unexpected endless stream of events even when there is no UI activity.
OnEditMenuUpdateUI called
OnEditMenuUpdateUI called
OnEditMenuUpdateUI called
.
.
.
Is this expected?
Don't know. Have you tried to place a breakpoint to see what triggers the events?
This is by design, because we update the menu item status in a single function, this function is called about 500ms(maybe another value, but I can't remember for now) at a time.
Quote from: ollydbg on January 25, 2017, 02:47:03 PM
This is by design, because we update the menu item status in a single function, this function is called about 500ms(maybe another value, but I can't remember for now) at a time.
Shouldn't this happen when the menu is clicked e.g. opened ?
Yves
Quote from: yvesdm3000 on January 25, 2017, 03:18:30 PM
Quote from: ollydbg on January 25, 2017, 02:47:03 PM
This is by design, because we update the menu item status in a single function, this function is called about 500ms(maybe another value, but I can't remember for now) at a time.
Shouldn't this happen when the menu is clicked e.g. opened ?
Yves
It should. But as far as I know, there are too many menu items and to many menu status, so we have some alternative way to update the menu status, see discussions here: wxUpdateUIEvent performance issues (http://forums.next.codeblocks.org/index.php/topic,11669.msg79334.html#msg79334)
EDIT: I just see in the source code, we have 100ms setting values.
MainFrame* CodeBlocksApp::InitFrame()
{
static_assert(wxMinimumVersion<2,8,12>::eval, "wxWidgets 2.8.12 is required");
MainFrame *frame = new MainFrame();
wxUpdateUIEvent::SetUpdateInterval(100);
SetTopWindow(nullptr);
if (g_DDEServer && m_DDE)
g_DDEServer->SetFrame(frame); // Set m_Frame in DDE-Server
return frame;
}
This is important information - thanks for the link.
It hasn't been discussed since 2009??
I think Jens' comments are worth noting - perhaps we should take heed in the release version?
1. Bind only one ID to the appropriate OnxxxMenuUpdateUI-function.
2. Set the update-interval to 500 ms (or 200 ms?).
What do you think?
I'd like to understand why we're binding all of the events - there must be a good reason - anybody know?
Lets start with: What is the real problem?
Good question. My original post was a request for information (which I got).
I'm trying to figure out why wxChoice items don't show up on custom toolbars in CodeBlocks
(at least on MacOS). As I began debugging, it was unexpected to receive so many events
(which seemed unnecessary) so I thought I'd ask.
I suppose the problem is that I don't have a design document for CodeBlocks.
There is no such thing as design document. Use the code svn blame/git blame are your best friends.