Changes in uspace/app/uidemo/uidemo.c [9a07ee3:9aa51406] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/uidemo/uidemo.c
r9a07ee3 r9aa51406 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 108 108 static void uidemo_file_load(ui_menu_entry_t *, void *); 109 109 static void uidemo_file_message(ui_menu_entry_t *, void *); 110 static void uidemo_file_confirmation(ui_menu_entry_t *, void *);111 110 static void uidemo_file_exit(ui_menu_entry_t *, void *); 112 111 static void uidemo_edit_modify(ui_menu_entry_t *, void *); … … 341 340 } 342 341 343 /** Display a message window with OK button.342 /** Display a message window. 344 343 * 345 344 * @param demo UI demo … … 406 405 mdparams.caption = "Message For You"; 407 406 mdparams.text = "Hello, world!"; 408 409 rc = ui_msg_dialog_create(demo->ui, &mdparams, &dialog);410 if (rc != EOK) {411 printf("Error creating message dialog.\n");412 return;413 }414 415 ui_msg_dialog_set_cb(dialog, &msg_dialog_cb, &demo);416 }417 418 /** File / Confirmation menu entry selected.419 *420 * @param mentry Menu entry421 * @param arg Argument (demo)422 */423 static void uidemo_file_confirmation(ui_menu_entry_t *mentry, void *arg)424 {425 ui_demo_t *demo = (ui_demo_t *) arg;426 ui_msg_dialog_params_t mdparams;427 ui_msg_dialog_t *dialog;428 errno_t rc;429 430 ui_msg_dialog_params_init(&mdparams);431 mdparams.caption = "Confirmation";432 mdparams.text = "This will not actually do anything. Proceed?";433 mdparams.choice = umdc_ok_cancel;434 407 435 408 rc = ui_msg_dialog_create(demo->ui, &mdparams, &dialog); … … 809 782 ui_menu_entry_set_cb(mmsg, uidemo_file_message, (void *) &demo); 810 783 811 rc = ui_menu_entry_create(demo.mfile, "~C~onfirmation", "", &mmsg);812 if (rc != EOK) {813 printf("Error creating menu.\n");814 return rc;815 }816 817 ui_menu_entry_set_cb(mmsg, uidemo_file_confirmation, (void *) &demo);818 819 784 rc = ui_menu_entry_create(demo.mfile, "~L~oad", "", &mload); 820 785 if (rc != EOK) {
Note:
See TracChangeset
for help on using the changeset viewer.