More on DYnamic Dialog question

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • More on DYnamic Dialog question

    I need to create changing dialogs at run time, and wonder what is the best or "right" way to do it.
    At creation, I can populat a non constant GUI_WIDGET_CREATE_INFO rescorce array and call GUI_CreateDialogBox, or I can loop thruog each object and built it, is there a difference?
    The other question is what to do whan a button is clicked, and a new dialog sholud be displayed.
    Should I delet all wigets, and rebuild new ones in the current window, or should I delet the parent window, and use a new resorce table?

    What is the correct way to do this? waht is more efficient and more "safe" in terms of memry allocation?
    Thanks
  • Hello,

    Using a resource table keeps the callback function small.

    Usually one should delete the current dialog and create a new one using another resource table.

    Dialogs can be deleted using either the function GUI_EndDialog() or WM_DeleteWindow(). GUI_EndDialog() has the special function for blocking dialogs to specify a dialog return value. For non blocking dialogs the functions GUI_EndDialog() and WM_DeleteWindow() have the same effect. Deleting a window in every case means deleting all of its descendants.

    Best regards,
    Adrian