Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Endless stream of events - CB-16.01

(1/2) > >>

ridge:
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?

oBFusCATed:
Don't know. Have you tried to place a breakpoint to see what triggers the events?

ollydbg:
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.

yvesdm3000:

--- 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.

--- End quote ---
Shouldn't this happen when the menu is clicked e.g. opened ?

Yves

ollydbg:

--- 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.

--- End quote ---
Shouldn't this happen when the menu is clicked e.g. opened ?

Yves

--- End quote ---
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

EDIT: I just see in the source code, we have 100ms setting values.

--- Code: ---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;
}
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version