static void mateHandleEvent (XEvent *event) { MATE_DISPLAY (&display); switch (event->type) { case KeyPress: if (isKeyPressEvent (event, &main_menu_key)) { BananaArgument arg[2]; arg[0].name = "root"; arg[0].type = BananaInt; arg[0].value.i = event->xkey.root; arg[1].name = "time"; arg[1].type = BananaInt; arg[1].value.i = event->xkey.time; showMainMenu (&arg[0], 2); } else if (isKeyPressEvent (event, &run_key)) { BananaArgument arg[2]; arg[0].name = "root"; arg[0].type = BananaInt; arg[0].value.i = event->xkey.root; arg[1].name = "time"; arg[1].type = BananaInt; arg[1].value.i = event->xkey.time; showRunDialog (&arg[0], 2); } else if (isKeyPressEvent (event, &run_command_screenshot_key)) { BananaArgument arg[2]; arg[0].name = "root"; arg[0].type = BananaInt; arg[0].value.i = event->xkey.root; const BananaValue * option_command_screenshot = bananaGetOption ( bananaIndex, "command_screenshot", -1); arg[1].name = "command"; arg[1].type = BananaString; arg[1].value.s = option_command_screenshot->s; runDispatch (&arg[0], 2); } else if (isKeyPressEvent (event, &run_command_window_screenshot_key)) { BananaArgument arg[2]; arg[0].name = "root"; arg[0].type = BananaInt; arg[0].value.i = event->xkey.root; const BananaValue * option_command_window_screenshot = bananaGetOption (bananaIndex, "command_window_screenshot", -1); arg[1].name = "command"; arg[1].type = BananaString; arg[1].value.s = option_command_window_screenshot->s; runDispatch (&arg[0], 2); } else if (isKeyPressEvent (event, &run_command_terminal_key)) { BananaArgument arg[2]; arg[0].name = "root"; arg[0].type = BananaInt; arg[0].value.i = event->xkey.root; const BananaValue * option_command_terminal = bananaGetOption ( bananaIndex, "command_terminal", -1); arg[1].name = "command"; arg[1].type = BananaString; arg[1].value.s = option_command_terminal->s; runDispatch (&arg[0], 2); } default: break; } UNWRAP (md, &display, handleEvent); (*display.handleEvent) (event); WRAP (md, &display, handleEvent, mateHandleEvent); }
/*! Stisk tlacitka run*/ void MainWindow::on_PB_run_clicked() { showRunDialog(); //zobrazi se dialog run }