Name
mui.CreateGUI -- create application object from an XML source
Synopsis
mui.CreateGUI(xml$)
Function
This function creates a MUI GUI from the XML description passed in the xml$ argument, i.e. it establishes the MUI master application object with all of its children. Please note that xml$ must be a string that contains the XML GUI declaration and not a filename. If you want to use an XML GUI declaration from an external file, you have to convert that file into a string first, e.g. using the FileToString() Hollywood function.

Once this function returns, you can talk to all your MUI objects that you have defined in the XML GUI declaration using the mui.Set(), mui.Get() and mui.DoMethod() functions.

Please note that there can be only one application object per task so this function can only be called once. If you want to call mui.CreateGUI() a second time, you have to free the old GUI first using the mui.FreeGUI() call.

If you need to dynamically add objects like windows or buttons to your application object, you can use the mui.CreateObject() function to do this.

Inputs
xml$
a string containing an XML GUI description
Example
mui.CreateGUI([[
<?xml version="1.0" encoding="iso-8859-1"?>
<application>
   <window title="Test program" notify="closerequest">
      <vgroup>
         <button>Hello World!</button>
      </vgroup>
   </window>
</application>
]])

InstallEventHandler({MUIRoyale = Function(msg)
      If msg.attribute = "CloseRequest" Then End
   EndFunction})

Repeat
   WaitEvent
Forever
The code above creates a minimal GUI, just with a window and a single button.

Show TOC