Changes in uspace/app/uidemo/uidemo.c [ef4d684:9a07ee3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/uidemo/uidemo.c
ref4d684 r9a07ee3 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2024 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 *); 110 111 static void uidemo_file_exit(ui_menu_entry_t *, void *); 111 112 static void uidemo_edit_modify(ui_menu_entry_t *, void *); … … 340 341 } 341 342 342 /** Display a message window .343 /** Display a message window with OK button. 343 344 * 344 345 * @param demo UI demo … … 405 406 mdparams.caption = "Message For You"; 406 407 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 entry 421 * @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; 407 434 408 435 rc = ui_msg_dialog_create(demo->ui, &mdparams, &dialog); … … 741 768 } 742 769 770 /* Only allow making the window larger */ 771 gfx_rect_dims(¶ms.rect, ¶ms.min_size); 772 743 773 rc = ui_window_create(ui, ¶ms, &window); 744 774 if (rc != EOK) { … … 778 808 779 809 ui_menu_entry_set_cb(mmsg, uidemo_file_message, (void *) &demo); 810 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); 780 818 781 819 rc = ui_menu_entry_create(demo.mfile, "~L~oad", "", &mload);
Note:
See TracChangeset
for help on using the changeset viewer.