LoadNativeUI ( file$[,owner] )

Parameters

file$ - path of a .ui document

owner (optional) - an existing window to own the new window; 0 for none (default)

Description

Loads a .ui form document and builds its window and gadgets, hidden.

A .ui document describes a whole window - its gadgets, their layout, fonts and images - so you can design a tool's dialogs once and load them, instead of placing every gadget in code. LoadNativeUI returns the form's root window, fully built but not yet shown. Look up the gadgets you need with FindNativeGadget, fill them in, then show the window with ShowNativeUI, so nobody sees a half-finished form.

The handle is an ordinary window gadget: events from the window have it as EventSource(), and the window commands work on it. Free the whole form with FreeNativeUI.

Everything is checked before anything appears: a missing file, an unreadable image or a bad layout makes LoadNativeUI return 0, with nothing left behind, and NativeUIError() says why. Events already waiting for your other windows are kept. The document stores no code and no handles, so your program wires up what each gadget does after loading.

Native UI documents are for Windows GUI programs.

For the full story, see the Native UI documents guide and its complete NativeUI.bb sample.


See also: ShowNativeUI, FindNativeGadget, FreeNativeUI, NativeUIError, CreateWindow.

Index