mirror of https://github.com/odrling/Aegisub
Only bind wxEVT_COMMAND_MENU_SELECTED once rather than once per command as large numbers of event handlers make wx explode
Originally committed to SVN as r5263.
This commit is contained in:
parent
88be46c657
commit
10c3a2ca16
|
@ -151,10 +151,7 @@ FrameMain::FrameMain (wxArrayString args)
|
|||
|
||||
StartupLog("Binding commands");
|
||||
// XXX: This is a hack for now, it will need to be dealt with when other frames are involved.
|
||||
int count = cmd::count();
|
||||
for (int i = 0; i < count; i++) {
|
||||
Bind(wxEVT_COMMAND_MENU_SELECTED, &FrameMain::cmd_call, this, i);
|
||||
}
|
||||
Bind(wxEVT_COMMAND_MENU_SELECTED, &FrameMain::cmd_call, this);
|
||||
|
||||
#ifdef __WXMAC__
|
||||
// Bind(FrameMain::OnAbout, &FrameMain::cmd_call, this, cmd::id("app/about"));
|
||||
|
@ -242,6 +239,7 @@ FrameMain::~FrameMain () {
|
|||
void FrameMain::cmd_call(wxCommandEvent& event) {
|
||||
int id = event.GetId();
|
||||
LOG_D("event/select") << "Id: " << id;
|
||||
if (id < cmd::count())
|
||||
cmd::call(context.get(), id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue