Is it possible to use XUI dialogs from ACL?

''Rob In der Maur (PTC) says... Yes!'' Last Updated: 2006-08-10

Don't know whether it's easier and better, but when using a XUI from ACL this is what I normally do:


 * 1) open the XUI file using xuiDoc = doc_open(xuiFile, ...)
 * 2) create the XUI window from the file you opened using xuiWin=window_create('xui', 0, xuiDoc);
 * 3) close the XUI file (set modified=off for not getting prompted for save) using doc_close(xuiDoc);
 * 4) now you have a handle to the window

and you can...
 * add callbacks using window_add_callback(xuiWindow, "destroy", "windowDestroyCallback");
 * add callbacks to buttons in the winddow using dlgitem_add_callback(xuiWindow, "btnOK", "btnPressedCallback");
 * get and set values from any control in your xui using dlgitem* routines. These actually work along the lines of the old VR-files.
 * switch images: dlgitem_set(xuiWindow, dlgitem, "IMAGE", imageID);

See Epic Help on dlgitem* routines for more information.

Note: An alternative to step 3 may be to use the flag 0x10 as the second argument to window_create. This way, the xui document will be destroyed automatically when the xui window is destroyed.

(Editors note by Karl Johan Kleist: Tung Fu added the last bullet item later)