예제 #1
0
// We can "show" (unhide) the main window when the
// application is hidden and it won't be visible.
// If we don't do this under wxCocoa 3.0, the Dock 
// icon will bounce (as in notification) when we
// click on our menu bar icon.
// But wxFrame::Show(true) makes the application
// visible again, so we instead call
// m_pFrame->wxWindow::Show() here.
//
// We need to call HideThisApp() after the event
// loop is running, so this is called from
// CBOINCBaseFrame::OnPeriodicRPC() at the first
// firing of ID_PERIODICRPCTIMER.
// 
void CBOINCGUIApp::OnFinishInit() {
    if (!m_bGUIVisible) {
        HideThisApp();
    
        m_pFrame->wxWindow::Show();
        
        if (m_pEventLog) {
            m_pEventLog->wxWindow::Show();
        }
    }
}
예제 #2
0
void set_mode(int mode) {
    if (mode == current_graphics_mode) {
        // Bring graphics window to front whenever user presses "Show graphics"
        if (mode == MODE_WINDOW) {
#ifdef __APPLE__
            BringAppToFront();
#else
            if (glut_is_freeglut && FREEGLUT_IS_INITIALIZED && (GLUT_HAVE_WINDOW > 0)) {
//              glutPopWindow();
       	        glutShowWindow();
            }
#endif 
       }
        return;
    }

    if (debug) fprintf(stderr, "set_mode(%d): current_mode = %d.\n", mode, current_graphics_mode);
    if (glut_is_initialized) {
        if (debug) fprintf(stderr, "Calling KillWindow(): win = %d\n", win);
        KillWindow();
        if (debug) fprintf(stderr, "KillWindow() survived.\n");
    }
    
    if (mode != MODE_HIDE_GRAPHICS) {
        if (debug) fprintf(stderr, "set_mode(): Calling make_new_window(%d)\n", mode); 
        make_new_window(mode);
        if (debug) fprintf(stderr, "make_new_window() survived.\n");
    }
#ifdef __APPLE__
    else
        HideThisApp();
#endif

    current_graphics_mode = mode;

    return;
}