void wxTreeListMainWindow::Expand (const wxTreeItemId& itemId) {
wxTreeListItem *item = (wxTreeListItem*) itemId.m_pItem;
wxCHECK_RET (item, _T("invalid item in wxTreeListMainWindow::Expand") );
if (!item->HasPlus() || item->IsExpanded()) return;
// send event to user code
wxTreeEvent event (wxEVT_COMMAND_TREE_ITEM_EXPANDING, m_owner->GetId());
#if !wxCHECK_VERSION(2, 5, 0)
event.SetItem ((long)item);
#else
event.SetItem (item);
#endif
event.SetEventObject (m_owner);
if (m_owner->ProcessEvent (event) && !event.IsAllowed()) return; // expand canceled
item->Expand();
m_dirty = true;
// send event to user code
event.SetEventType (wxEVT_COMMAND_TREE_ITEM_EXPANDED);
m_owner->ProcessEvent (event);
wxTreeListItem *item = (wxTreeListItem*) itemId.m_pItem;
wxCHECK_RET (item, _T("invalid item in wxTreeListMainWindow::Expand") );
if (!item->HasPlus() || item->IsExpanded()) return;
// send event to user code
wxTreeEvent event (wxEVT_COMMAND_TREE_ITEM_EXPANDING, m_owner->GetId());
#if !wxCHECK_VERSION(2, 5, 0)
event.SetItem ((long)item);
#else
event.SetItem (item);
#endif
event.SetEventObject (m_owner);
if (m_owner->ProcessEvent (event) && !event.IsAllowed()) return; // expand canceled
item->Expand();
m_dirty = true;
// send event to user code
event.SetEventType (wxEVT_COMMAND_TREE_ITEM_EXPANDED);
m_owner->ProcessEvent (event);
}
事件在调用expand 时发送了?
不是GUI线程调用expand的同时发送的吗?