예제 #1
0
MenuHandle NewUniqueMenu()
{
    MenuHandle handle = UMANewMenu(nextPopUpMenuId, wxString(wxT("Menu")), wxFont::GetDefaultEncoding() );
    nextPopUpMenuId++ ;

    return handle ;
}
예제 #2
0
파일: menu.cpp 프로젝트: czxxjtu/wxPython-1
void wxMenu::Init()
{
    m_doBreak = false;
    m_startRadioGroup = -1;

    // create the menu
    m_macMenuId = s_macNextMenuId++;
    m_hMenu = UMANewMenu(m_macMenuId, m_title, wxFont::GetDefaultEncoding() );

    if ( !m_hMenu )
    {
        wxLogLastError(wxT("UMANewMenu failed"));
    }

    wxAssociateMenuWithMacMenu( (MenuRef)m_hMenu , this ) ;

    // if we have a title, insert it in the beginning of the menu
    if ( !m_title.empty() )
    {
        Append(idMenuTitle, m_title) ;
        AppendSeparator() ;
    }
}