Functions for wxXmlResource class

This is the main class for interacting with the XML-based resource system.

The class holds XML resources from one or more .xml files, binary files or zip archive files.

Note that this is a singleton class and you'll never allocate/deallocate it. Just use the static get/0 getter.

See: Overview xrc, Overview xrcformat

wxWidgets docs: wxXmlResource


Removes all handlers and deletes them (this means that any handlers added using AddHandler() (not implemented in wx) must be allocated on the heap).


Major = Minor = Release = Revision = integer()

Compares the XRC version to the argument.

Returns -1 if the XRC version is less than the argument, +1 if greater, and 0 if they are equal.

Gets the global resources object or creates one if none exists.


Returns flags, which may be a bitlist of ?wxXmlResourceFlags enumeration values.


Returns version information (a.b.c.d = d + 256*c + 2562*b + 2563*a).


Option = {value_if_not_found, integer()}

Returns a numeric ID that is equivalent to the string ID used in an XML resource.

If an unknown str_id is requested (i.e. other than wxID_XXX or integer), a new record is created which associates the given string with a number.

If value_if_not_found is wxID_NONE, the number is obtained via wx_misc:newId/0. Otherwise value_if_not_found is used.

Macro XRCID(name) is provided for convenient use in event tables.

Note: IDs returned by XRCID() cannot be used with the EVT_*_RANGE macros, because the order in which they are assigned to symbolic name values is not guaranteed.


Initializes handlers for all supported controls/windows.

This will make the executable quite big because it forces linking against most of the wxWidgets library.


Loads resources from XML files that match given filemask.


Note: If wxUSE_FILESYS is enabled, this method understands wxFileSystem (not implemented in wx) URLs (see wxFileSystem::FindFirst() (not implemented in wx)).

Note: If you are sure that the argument is name of single XRC file (rather than an URL or a wildcard), use LoadFile() (not implemented in wx) instead.

See: LoadFile() (not implemented in wx), LoadAllFiles() (not implemented in wx)


Flags = integer()

Sets flags (bitlist of ?wxXmlResourceFlags enumeration values).


This function unloads a resource previously loaded by load/2.

Returns true if the resource was successfully unloaded and false if it hasn't been found in the list of loaded resources.


Name = string()
Type = atom()

Looks up a control.

Get a control with Name in a window created with XML resources. You can use it to set/get values from controls. The object is type casted to Type. Example: