void addCallbackButton(void (* func)(),
                       const std::string& text,
                       const std::string& icon) {
    if (isGraphicalUI()) {
        stanfordcpplib::autograder::GuiAutograder::instance()->addCallbackButton(func, text, icon);
    } else {
        // empty
    }
}
예제 #2
0
void showOutput(const std::string& output, bool showIfGraphical, bool showIfConsole) {
    if (isGraphicalUI()) {
        if (showIfGraphical) {
            GOptionPane::showMessageDialog(output);
        }
    } else {
        // not graphical UI
        if (showIfConsole) {
            std::cout << output << std::endl;
        }
    }
}