Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/uidemo/uidemo.c

    r9a07ee3 r9aa51406  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    108108static void uidemo_file_load(ui_menu_entry_t *, void *);
    109109static void uidemo_file_message(ui_menu_entry_t *, void *);
    110 static void uidemo_file_confirmation(ui_menu_entry_t *, void *);
    111110static void uidemo_file_exit(ui_menu_entry_t *, void *);
    112111static void uidemo_edit_modify(ui_menu_entry_t *, void *);
     
    341340}
    342341
    343 /** Display a message window with OK button.
     342/** Display a message window.
    344343 *
    345344 * @param demo UI demo
     
    406405        mdparams.caption = "Message For You";
    407406        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;
    434407
    435408        rc = ui_msg_dialog_create(demo->ui, &mdparams, &dialog);
     
    809782        ui_menu_entry_set_cb(mmsg, uidemo_file_message, (void *) &demo);
    810783
    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 
    819784        rc = ui_menu_entry_create(demo.mfile, "~L~oad", "", &mload);
    820785        if (rc != EOK) {
Note: See TracChangeset for help on using the changeset viewer.