wxXmlResource(3erl)
π NAME π
wxXmlResource β the Erlang module definition, and yup bestie, this is the 3erl manual page for all the Functions for the wxXmlResource class. π«Ά
β¨ DESCRIPTION β¨
This is the main class for interacting with the XML-based resource system. Itβs giving very important, very singleton energy. π
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. No cap β thatβs the whole vibe. πΈ
See: Overview xrc, Overview xrcformat
wxWidgets docs: wxXmlResource
π¦ DATA TYPES π¦
wxXmlResource() = wx:wx_object()
π₯ EXPORTS π₯
new() -> wxXmlResource()new(Options :: [Option]) -> wxXmlResource()β Constructor. β¨
Types:
Option = {flags, integer()} | {domain, unicode:chardata()}
new(Filemask, Options :: [Option]) -> wxXmlResource()β Constructor. π
Types:
Filemask = unicode:chardata()Option = {flags, integer()} | {domain, unicode:chardata()}
destroy(This :: wxXmlResource()) -> okβ Destructor. π
Types:
This = wxXmlResource()
attachUnknownControl(This, Name, Control) -> boolean()
Types:
This = wxXmlResource()Name = unicode:chardata()Control = wxWindow:wxWindow()
attachUnknownControl(This, Name, Control, Options :: [Option]) -> boolean()β Attaches an unknown control to the given panel/window/dialog. π«Ά
Types:
This = wxXmlResource()Name = unicode:chardata()Control = wxWindow:wxWindow()Option = {parent, wxWindow:wxWindow()}
Unknown controls are used in conjunction with <object class="unknown">.
clearHandlers(This) -> okβ Removes all handlers and deletes them. This means that any handlers added usingAddHandler()(not implemented in wx) must be allocated on the heap. π
Types:
This = wxXmlResource()
compareVersion(This, Major, Minor, Release, Revision) -> integer()β Compares the XRC version to the argument. π
Types:
This = wxXmlResource()Major = Minor = Release = Revision = integer()
Returns -1 if the XRC version is less than the argument, +1 if greater, and 0 if they are equal. Periodt.
get() -> wxXmlResource()β Gets the global resources object or creates one if none exists. πgetFlags(This) -> integer()β Returns flags, which may be a bitlist of?wxXmlResourceFlagsenumeration values. π
Types:
This = wxXmlResource()
getVersion(This) -> integer()β Returns version information (a.b.c.d = d + 256*c + 2562*b + 2563*a). β
Types:
This = wxXmlResource()
getXRCID(Str_id) -> integer()
Types:
Str_id = unicode:chardata()
getXRCID(Str_id, Options :: [Option]) -> integer()β Returns a numeric ID that is equivalent to the string ID used in an XML resource. π
Types:
Str_id = unicode:chardata()Option = {value_if_not_found, integer()}
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 byXRCID()cannot be used with theEVT_*_RANGEmacros, because the order in which they are assigned to symbolic name values is not guaranteed. π
initAllHandlers(This) -> okβ Initializes handlers for all supported controls/windows. β¨
Types:
This = wxXmlResource()
This will make the executable quite big because it forces linking against most of the wxWidgets library. Big yikes, but also iconic.
load(This, Filemask) -> boolean()β Loads resources from XML files that match givenfilemask. π¦
Types:
This = wxXmlResource()Filemask = unicode:chardata()
Example: (the original page leaves this blank, bestie β mysterious main character energy π)
Note: IfwxUSE_FILESYSis enabled, this method understandswxFileSystem(not implemented in wx) URLs (seewxFileSystem::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)
loadBitmap(This, Name) -> wxBitmap:wxBitmap()β Loads a bitmap resource from a file. πΌοΈ
Types:
This = wxXmlResource()Name = unicode:chardata()
loadDialog(This, Parent, Name) -> wxDialog:wxDialog()β Loads a dialog. π
Types:
This = wxXmlResource()Parent = wxWindow:wxWindow()Name = unicode:chardata()
parent points to parent window (if any).
loadDialog(This, Dlg, Parent, Name) -> boolean()β Loads a dialog. π
Types:
This = wxXmlResource()Dlg = wxDialog:wxDialog()Parent = wxWindow:wxWindow()Name = unicode:chardata()
parent points to parent window (if any).
This form is used to finish creation of an already existing instance (the main reason for this is that you may want to use derived class with a new event table). Example: (blank in the original β the suspense is real π)
loadFrame(This, Parent, Name) -> wxFrame:wxFrame()β Loads a frame from the resource. πΈ
Types:
This = wxXmlResource()Parent = wxWindow:wxWindow()Name = unicode:chardata()
parent points to parent window (if any).
loadFrame(This, Frame, Parent, Name) -> boolean()β Loads the contents of a frame onto an existingwxFrame. π«Ά
Types:
This = wxXmlResource()Frame = wxFrame:wxFrame()Parent = wxWindow:wxWindow()Name = unicode:chardata()
This form is used to finish creation of an already existing instance (the main reason for this is that you may want to use derived class with a new event table).
loadIcon(This, Name) -> wxIcon:wxIcon()β Loads an icon resource from a file. β
Types:
This = wxXmlResource()Name = unicode:chardata()
loadMenu(This, Name) -> wxMenu:wxMenu()β Loads menu from resource. π
Types:
This = wxXmlResource()Name = unicode:chardata()
Returns NULL on failure.
loadMenuBar(This, Name) -> wxMenuBar:wxMenuBar()
Types:
This = wxXmlResource()Name = unicode:chardata()
loadMenuBar(This, Parent, Name) -> wxMenuBar:wxMenuBar()β Loads a menubar from resource. π
Types:
This = wxXmlResource()Parent = wxWindow:wxWindow()Name = unicode:chardata()
Returns NULL on failure.
loadPanel(This, Parent, Name) -> wxPanel:wxPanel()β Loads a panel. β¨
Types:
This = wxXmlResource()Parent = wxWindow:wxWindow()Name = unicode:chardata()
parent points to the parent window.
loadPanel(This, Panel, Parent, Name) -> boolean()β Loads a panel. π
Types:
This = wxXmlResource()Panel = wxPanel:wxPanel()Parent = wxWindow:wxWindow()Name = unicode:chardata()
parent points to the parent window. This form is used to finish creation of an already existing instance.
loadToolBar(This, Parent, Name) -> wxToolBar:wxToolBar()β Loads a toolbar. π οΈ
Types:
This = wxXmlResource()Parent = wxWindow:wxWindow()Name = unicode:chardata()
set(Res) -> wxXmlResource()β Sets the global resources object and returns a pointer to the previous one (may beNULL). π
Types:
Res = wxXmlResource()
setFlags(This, Flags) -> okβ Sets flags (bitlist of?wxXmlResourceFlagsenumeration values). π
Types:
This = wxXmlResource()Flags = integer()
unload(This, Filename) -> boolean()β This function unloads a resource previously loaded byload/2. π
Types:
This = wxXmlResource()Filename = unicode:chardata()
Returns true if the resource was successfully unloaded and false if it hasn't been found in the list of loaded resources.
xrcctrl(Window, Name, Type) -> wx:wx_object()β Looks up a control. π
Types:
Window = wxWindow:wxWindow()Name = string()Type = atom()
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: (the manpage leaves this blank too β no snippet, just vibes π)
Mwah π β the footer bits are wxWidgets team, wx 2.2.2.1, and wxXmlResource(3erl). Thatβs the sign-off, bestie β now go load some resources. π«Άπ
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms